2011. május 27. 16:31 írta, <spa...@gmail.com>: > I think the way - d = dict({'one': 1, 'two': 2}) can be used to created > dictionary using list comprehension. > e.g. > >>> d = dict((i,i**2) for i in range(10)) > > I think this is not the same syntax, there are no braces in. dict({'one': 1, 'two': 2}) rather seems to me as a converting function that creates a dictionary from a dictionary.
Thank you anyway!
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor