0

I have an error and idk why -.- pls help me

i type: i=1 while i<=5: Print(i) i+=1 Print("finished") (i=i + 1 dont works too) the error is at the first line (i = 1) and i dont know why -.- i write and notepad++ and copy this to the idle

31st Mar 2017, 7:19 AM
Shark Hide
Shark Hide - avatar
13 Respuestas
+ 8
You have to indent your code (with 4 spaces traditionally): i=1 while i<=5: print(i) i+=1 print("finished") also, Python is case-sensitive, so use 'print' instead of 'Print'.
31st Mar 2017, 7:23 AM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 5
Weird... Can you cite the error message you are getting?
31st Mar 2017, 8:34 AM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 5
Hmm... are you sure you are copying it to the IDE and not the console? The console (>>>) accepts only one-line commands at a time.
31st Mar 2017, 8:41 AM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 5
You have two options: either write commands in the console/shell (>>>) or use an editor. The second one is better for making scripts actually :) Standard, OS-based copy&paste should work. But also, you can define Python interpreter in Notepad++ so it would run your code right away, without the need to copy&paste.
31st Mar 2017, 8:51 AM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 4
Check it out in the Playground: https://code.sololearn.com/c2ZQvSOXV92l/?ref=app
31st Mar 2017, 7:43 AM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 4
What kind of IDE you are using?
31st Mar 2017, 8:24 AM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
0
so i write the same like you in the Idle and i get the same error :/ PS I write print with p but my smartphone write a P here idk why :D
31st Mar 2017, 7:28 AM
Shark Hide
Shark Hide - avatar
0
it works here but why it don't work on my PC ? :/
31st Mar 2017, 7:44 AM
Shark Hide
Shark Hide - avatar
0
IDLE (Python 3.6 64-bit)
31st Mar 2017, 8:32 AM
Shark Hide
Shark Hide - avatar
0
Sure SyntaxError: multiple statements found while compiling a single statement and the line with "i=1" is marked
31st Mar 2017, 8:37 AM
Shark Hide
Shark Hide - avatar
0
oh aehm .... how I can write/copy this in the ide ?
31st Mar 2017, 8:43 AM
Shark Hide
Shark Hide - avatar
0
I copy and paste this from notepad++ to this idle program from python and than "error"
31st Mar 2017, 8:52 AM
Shark Hide
Shark Hide - avatar
0
do you have ts3 ? I think that's easier than write everything here xD
31st Mar 2017, 8:53 AM
Shark Hide
Shark Hide - avatar