+ 1
This code isn't running, what'd be the problem?
for n in range (5): for i in range (4): print(i) print(n)
4 Réponses
+ 4
The variable names in the for are both i, but you want to print i and n. Change the first for with for n in range
+ 3
> the inner loop does not have a correct indentation for `print(i)`
> also the outer loop with `print(n)` has an incorrect indentation.
*in general*: try to read and understand the error messages from python. they are clearly pointing out the issues and the line number where the issue happens.
+ 1
There are some errors here:
Both for loops have the same variable name, which will lead to strange behavior
But variable n isnt defined, so the code wont even run
You should change the i in the first loop to a n, so it will work
Hope this helps :)
0
'print(i)' must be indented