Total Pageviews

Popular posts

 Tuples in Python are values separated by commas. Enclosing parentheses for inputting tuples are optional, so the two assignments

a = 1, 2, 3   # a is the tuple (1, 2, 3)

and

a = (1, 2, 3) # a is the tuple (1, 2, 3)

are equivalent. The assignment a = 1, 2, 3 is also called packing because it packs values together in a tuple.

Note that a one-value tuple is also a tuple. To tell Python that a variable is a tuple and not a single value you can use a trailing comma



No comments

ict note in A/L

3/Technology ict note in A/L/post-list