+ 1
Can any one say me why the numbers in range are not printing?
2 Antworten
+ 5
ABHISHEK GERA in your code X = 0 is initialised and further X is used only in true condition where x = x+1
So in last statement you used only X==2 in condition which evaluate too true at once and print 11 and terminated. I've updated your code slightly look over that
https://code.sololearn.com/cjlwUpQ41fGM/?ref=app
0
Only the number 11 is being printed. That's because your x variable is not being reset on every cycle.
To correct your code, just move your "x = 0" declaration to inside the first for loop, right at the beginning.
for i in range(11,33):
x = 0
... # the rest is the same
Happy coding!