Single-Element Tuples : Introduction « Tuple « Python Tutorial






print ['abc']
print type(['abc'])   # a list
print ('xyz')
print type(('xyz'))   # a string, not a tuple
print ('xyz',)








6.1.Introduction
6.1.1.Tuples: Immutable Sequences
6.1.2.How to write a tuple containing a single value.
6.1.3.Single-Element Tuples
6.1.4.One comma can change the value of an expression completely:
6.1.5.Using Tuples
6.1.6.Assigning Multiple Values at Once
6.1.7.Built-in Functions