mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 17:41:41 +00:00
Remove however in unpacking commenting. It's confusing
This commit is contained in:
parent
445041776c
commit
cbb2ef1197
@ -139,7 +139,7 @@ tup + (4, 5, 6) #=> (1, 2, 3, 4, 5, 6)
|
|||||||
tup[:2] #=> (1, 2)
|
tup[:2] #=> (1, 2)
|
||||||
2 in tup #=> True
|
2 in tup #=> True
|
||||||
|
|
||||||
# However, you can unpack tuples into variables
|
# You can unpack tuples into variables
|
||||||
a, b, c = (1, 2, 3) # a is now 1, b is now 2 and c is now 3
|
a, b, c = (1, 2, 3) # a is now 1, b is now 2 and c is now 3
|
||||||
# Tuples are created by default if you leave out the parentheses
|
# Tuples are created by default if you leave out the parentheses
|
||||||
d, e, f = 4, 5, 6
|
d, e, f = 4, 5, 6
|
||||||
|
Loading…
Reference in New Issue
Block a user