fork download
  1. current = [0, 1]
  2. someList = []
  3. while True:
  4. for n in range(0, 2):
  5. current[n] += 1
  6. print(current)
  7. someList.append(current[:]) #aqui faz uma cópia da lista e usa referêwncia para esta cópia, não a original
  8. if current == [2, 3]:
  9. break
  10. print(someList)
  11.  
  12. #https://pt.stackoverflow.com/q/425908/101
Success #stdin #stdout 0.02s 9088KB
stdin
Standard input is empty
stdout
[1, 2]
[2, 3]
[[1, 2], [2, 3]]