mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-04-27 07:33:57 +00:00
Merge c51d0ec1a7
into e1cf0fb958
This commit is contained in:
commit
47e2d1054a
@ -228,7 +228,7 @@ empty_set = set()
|
||||
some_set = set([1,2,2,3,4]) # filled_set is now set([1, 2, 3, 4])
|
||||
|
||||
# Since Python 2.7, {} can be used to declare a set
|
||||
filled_set = {1 2 2 3 4} # => {1 2 3 4}
|
||||
filled_set = {1, 2, 2, 3, 4} # => {1 2 3 4}
|
||||
|
||||
# Add more items to a set
|
||||
filled_set.add(5) # filled_set is now {1, 2, 3, 4, 5}
|
||||
|
Loading…
Reference in New Issue
Block a user