Facebook
From Trivial Bongo, 3 Years ago, written in Python.
Embed
Download Paste or View Raw
Hits: 215
  1. import copy
  2. simple_list = ['a', 'b', 'c']
  3. my_list = [
  4.     ['a', 'b', 'c'],
  5.     ['d', 'e', 'f'],
  6.     ['g', 'h', 'i'],
  7. ]
  8.  
  9. do_dodania = ['j', 'k', 'l']
  10. my_list.append(do_dodania)
  11.  
  12. my_list[0].append('s')
  13.  
  14. for list in my_list:
  15.     list.append('xyz')
  16.  
  17. print(my_list)
  18.  
  19. # copy_list = copy.copy(my_list)
  20. # deep_copy_list = copy.deepcopy(my_list)
  21. # deep_copy_list[0][0] = 'x'
  22. #
  23. #
  24. #
  25. # for y in my_list:
  26. #     for x in y:
  27. #         if x == 'e':
  28. #             print(my_list.index(y))
  29. #             print(y.index(x))
  30. #             break