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
13 Antworten
+ 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'.
+ 5
Weird...
Can you cite the error message you are getting?
+ 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.
+ 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.
+ 4
Check it out in the Playground:
https://code.sololearn.com/c2ZQvSOXV92l/?ref=app
+ 4
What kind of IDE you are using?
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
0
it works here but why it don't work on my PC ? :/
0
IDLE (Python 3.6 64-bit)
0
Sure
SyntaxError: multiple statements found while compiling a single statement
and the line with "i=1" is marked
0
oh aehm ....
how I can write/copy this in the ide ?
0
I copy and paste this from notepad++ to this idle program from python and than "error"
0
do you have ts3 ? I think that's easier than write everything here xD