mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 09:41:36 +00:00
Update python3.html.markdown (#2776)
This commit is contained in:
parent
ec10b15702
commit
e78e41ce30
@ -345,6 +345,7 @@ invalid_set = {[1], 1} # => Raises a TypeError: unhashable type: 'list'
|
|||||||
valid_set = {(1,), 1}
|
valid_set = {(1,), 1}
|
||||||
|
|
||||||
# Add one more item to the set
|
# Add one more item to the set
|
||||||
|
filled_set = some_set
|
||||||
filled_set.add(5) # filled_set is now {1, 2, 3, 4, 5}
|
filled_set.add(5) # filled_set is now {1, 2, 3, 4, 5}
|
||||||
|
|
||||||
# Do set intersection with &
|
# Do set intersection with &
|
||||||
|
Loading…
Reference in New Issue
Block a user