snippets.txt 610 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # Mutable
  2. list_1 = ['History', 'Math', 'Physics', 'CompSci']
  3. list_2 = list_1
  4. print(list_1)
  5. print(list_2)
  6. # list_1[0] = 'Art'
  7. # print(list_1)
  8. # print(list_2)
  9. # Immutable
  10. # tuple_1 = ('History', 'Math', 'Physics', 'CompSci')
  11. # tuple_2 = tuple_1
  12. # print(tuple_1)
  13. # print(tuple_2)
  14. # tuple_1[0] = 'Art'
  15. # print(tuple_1)
  16. # print(tuple_2)
  17. # Sets
  18. cs_courses = {'History', 'Math', 'Physics', 'CompSci'}
  19. print(cs_courses)
  20. # Empty Lists
  21. empty_list = []
  22. empty_list = list()
  23. # Empty Tuples
  24. empty_tuple = ()
  25. empty_tuple = tuple()
  26. # Empty Sets
  27. empty_set = {} # This isn't right! It's a dict
  28. empty_set = set()