New course! Every coder should learn Generative AI!
Try a free lesson+ 1
What's wrong with my code
for x in range(0, 10): print(x, " ", end="") print("\n") grocery_list = ["juice" , "Tomatoes" , "Potatoes", "Bananas"] for y in grocery_list: print(y) for x in [2,4,6,8,10]: print(x) num_list = [[1,2,3],[10,20,30,][100,200,330]] for x in range(0, 3): for y in range(0,3): print(num_list[x][y])
3 Answers
0
maybe this s your code :
for x in range(0, 10):
print(x, " ", end="")
print("\n")
grocery_list = ["juice" , "Tomatoes" , "Potatoes", "Bananas"]
for y in grocery_list:
print(y)
for x in [2,4,6,8,10]:
print(x)
num_list = [[1,2,3],[10,20,30],[100,200,300]]
for x in range(0,3):
for y in range(0,3):
print(num_list[x][y])
0
?
0
Found the issue! A simple missing comma turned into a mini-nightmare. On line 14 in the list num_list, you've forgotten a comma between the lists of [10,20,30] and [100,200,300]