Tuesday, 15 May 2012

Tuples with P. Guo's Online Python Tutor

Tuples


Code Listing:
unique_tuple  = 'a', 'tuple', 'is',
unique_tuple2 = 'an', 'ordered', 'list',
unique_tuple3 = 'of', 'elements'

unique_tuple  = 'A tuple, values','separated'
unique_tuple2 = 'by', 'commas'
unique_tuple3 = 'immutable', 'object'
print "strings, numbers, and tuples are immutable"


No comments:

Post a Comment