[Tutor] the sense of brackets

spir denis.spir at free.fr
Sat Nov 22 16:42:29 CET 2008


I have long thought "[]" /simply/ is a list constructor syntax.
What do you think of the following?

t = "aze"
print t, list(t), [t]
print list(list(t)), list([t]), [list(t)], [[t]]
==>
aze ['a', 'z', 'e'] ['aze']
['a', 'z', 'e'] ['aze'] [['a', 'z', 'e']] [['aze']]


More information about the Tutor mailing list