+ 15
How to write last statement of this code ?
I don't know how to write last line of this code on Python 3.6.4 ide whenever I write this statement then there is a syntax error plz help thanks in advance https://code.sololearn.com/cznSZc7I4zsX/?ref=app
13 odpowiedzi
+ 10
I don't know why I got syntax error btw thanks for your help
+ 8
Please be more specific. Do you copy the code EXACTLY!
+ 8
I ran the code on Python 3.6.4 IDLE and it worked fine with and without a space before the final line.
Are you sure you haven't copied any stray characters?
I would start with a new blank code in your IDE and type in the code from scratch rather than pasting it and then see if that works.
+ 8
thanks EnderLord for your help
+ 7
yes but I can't write last line do you use Python 3.6.4
+ 7
I just want to get full output as provide by code playground but I can't because I don't know how to write last statement
+ 6
@EnderLord this works fine on code playground but I got syntax error on Python 3.6.4 ide
+ 5
What is your task?
+ 1
The code you gave us- has the last line been written or did you leave it out?
+ 1
When I ran it it went ok and I don’t see what else to add other than a comment
+ 1
You can try
i = 0
while 1 == 1:
print(i)
i += 1
if i >= 5:
print(“Ending”)
print(“Finished”)
quit()
And it will do the same thing however it Will technically not break the while loop but instead shut the entire shell down
+ 1
Also I got the same problem as you did with the print(“finished”) thing
+ 1
If you wanted to test while loops I would suggest using files instead of the shell or come up with a new code