I have the following program which successfully creates a 10x20 array filled with zeros:
array2 = []
array2=[[0 for j in range(10)] for i in range(20)]
print array2
I then tried to do the same with a for loop and a while loop:
for j in range(20):
for i in range(10):
array1.append(0)
print array1
array3 = []
count = 0
while count <= 20:
count += 1
while count <= 10:
array3.append(0)
count += 1
print array3
I feel like I am on the right track, but I can not seem to be able to create the same thing with these loops. How can I tweak these loops in order to create the same effect as the first one? Thank you.