mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-04-27 07:33:57 +00:00
Fix set syntax error
This commit is contained in:
parent
a6bcf5f8d7
commit
f79c4b5cfa
@ -234,7 +234,7 @@ filled_set = {1 2 2 3 4} # => {1 2 3 4}
|
||||
filled_set.add(5) # filled_set is now {1, 2, 3, 4, 5}
|
||||
|
||||
# Do set intersection with &
|
||||
other_set = set{3, 4, 5, 6}
|
||||
other_set = set([3, 4, 5, 6])
|
||||
filled_set & other_set #=> {3, 4, 5}
|
||||
|
||||
# Do set union with |
|
||||
|
Loading…
Reference in New Issue
Block a user