0
why this is printing like this?
3 odpowiedzi
0
I believe you want to print out the elements of the list till it gets to 55.
Then, the mistake is in the for loop.
It ought to be;
for y in x:
print(y)
if y == 55:
break
but this code will include 55. The name of your code is 'break 55' so i think it ought to break when it encounters 55 hence, the checking for 55 should come before the printing. The final for loop would then be...
for y in x:
if y == 55:
break
print(y)
#hope this helps.
+ 1
thanks
+ 1
My pleasure