Aug-16-2018, 12:12 PM
Lists are mutable. When you copy them with
[[3]] * 3
it copies three references to the same list. Use a list comprehension instead: [[3] for sublist in range(3)]
. With a list comprehension, the sub-list is reevaluated each time through the loop, giving you three independent sub-lists.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures