tuple assignment : Tuple Creation « Tuple « Python






tuple assignment

tuple assignment
nudge = 1

wink  = 2

A, B = nudge, wink             # tuple assignment

print A, B                           # like A=nudge; B=wink

[C, D] = [nudge, wink]         # list assignment

print C, D


           
       








Related examples in the same category

1.Tuple sequenceTuple sequence
2.tuples: swaps valuestuples: swaps values
3.Tuple assigmentTuple assigment
4.Create tuple from an integerCreate tuple from an integer
5.A tuple containing an integerA tuple containing an integer