+ 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

3rd Jan 2018, 8:21 AM
Randeep Singh
Randeep Singh - avatar
13 Answers
+ 10
I don't know why I got syntax error btw thanks for your help
3rd Jan 2018, 11:35 AM
Randeep Singh
Randeep Singh - avatar
+ 8
Please be more specific. Do you copy the code EXACTLY!
3rd Jan 2018, 10:02 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 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.
3rd Jan 2018, 11:07 AM
David Ashton
David Ashton - avatar
+ 8
thanks EnderLord for your help
4th Jan 2018, 4:52 AM
Randeep Singh
Randeep Singh - avatar
+ 7
yes but I can't write last line do you use Python 3.6.4
3rd Jan 2018, 10:07 AM
Randeep Singh
Randeep Singh - avatar
+ 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
3rd Jan 2018, 10:12 AM
Randeep Singh
Randeep Singh - avatar
+ 6
@EnderLord this works fine on code playground but I got syntax error on Python 3.6.4 ide
3rd Jan 2018, 2:10 PM
Randeep Singh
Randeep Singh - avatar
+ 5
What is your task?
3rd Jan 2018, 10:07 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 1
The code you gave us- has the last line been written or did you leave it out?
3rd Jan 2018, 2:08 PM
Delegator
Delegator - avatar
+ 1
When I ran it it went ok and I don’t see what else to add other than a comment
3rd Jan 2018, 2:09 PM
Delegator
Delegator - avatar
+ 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
3rd Jan 2018, 6:53 PM
Delegator
Delegator - avatar
+ 1
Also I got the same problem as you did with the print(“finished”) thing
3rd Jan 2018, 6:54 PM
Delegator
Delegator - avatar
+ 1
If you wanted to test while loops I would suggest using files instead of the shell or come up with a new code
3rd Jan 2018, 6:56 PM
Delegator
Delegator - avatar