I\'m trying to populate a list with a for loop. This is what I have so far:
newlist = [] for x in range(10): for y in range(10): newlist.append(y
You can use this one line code with list comprehension to achieve the same result:
new_list = [[i for i in range(10)] for j in range(10)]