diff options
-rw-r--r-- | python3.html.markdown | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/python3.html.markdown b/python3.html.markdown index 7683bc60..c7fbf342 100644 --- a/python3.html.markdown +++ b/python3.html.markdown @@ -281,7 +281,8 @@ a, b, c = (1, 2, 3) # a is now 1, b is now 2 and c is now 3 # You can also do extended unpacking a, *b, c = (1, 2, 3, 4) # a is now 1, b is now [2, 3] and c is now 4 # Tuples are created by default if you leave out the parentheses -d, e, f = 4, 5, 6 +d, e, f = 4, 5, 6 # tuple 4, 5, 6 is unpacked into variables d, e and f +# respectively such that d = 4, e = 5 and f = 6 # Now look how easy it is to swap two values e, d = d, e # d is now 5 and e is now 4 |