1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-08-10 16:54:33 +02:00

Merge pull request #36 from jbub/fixsets

python set literals should be separated by comma
This commit is contained in:
Adam Bard
2013-06-29 07:37:43 -07:00

View File

@@ -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}