From 30cdf4b25327e01c751db384e42692fd95178db1 Mon Sep 17 00:00:00 2001 From: Divay Prakash Date: Fri, 26 Oct 2018 02:35:15 +0530 Subject: Fix tuple unpacking example in python3, closes #3130 (#3328) --- python3.html.markdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'python3.html.markdown') 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 -- cgit v1.2.3