What's wrong with my code | Sololearn: Learn to code for FREE!
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])

6th Nov 2016, 12:03 PM
code-junkie
code-junkie - avatar
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])
6th Nov 2016, 5:47 PM
Bal
Bal - avatar
0
?
7th Nov 2016, 8:25 AM
code-junkie
code-junkie - avatar
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]
8th Nov 2016, 12:36 PM
Alex Schrichte
Alex Schrichte - avatar