tuples: swaps values : Tuple Creation « Tuple « Python






tuples: swaps values

tuples: swaps values


nudge = 1
wink  = 2
nudge, wink = wink, nudge      # tuples: swaps values
print nudge, wink                    # like T=nudge; nudge=wink; wink=T

           
       








Related examples in the same category

1.Tuple sequenceTuple sequence
2.tuple assignmenttuple assignment
3.Tuple assigmentTuple assigment
4.Create tuple from an integerCreate tuple from an integer
5.A tuple containing an integerA tuple containing an integer