+ 4

When I am writing some different codes steb by steb in pc python idle, there is intax error, if I write one code only it work?!

why? who knos tell please

28th Mar 2017, 1:29 PM
Nasibillo Muhamedov
Nasibillo Muhamedov - avatar
4 Answers
+ 3
Do you have a brief example code, where this goes wrong? My first idea would be, that you don't enter blocks that span several lines, like for loops, correctly.
28th Mar 2017, 2:13 PM
Tob
Tob - avatar
+ 3
@Jason Hoffman: You can get more than one line in the shell. Just try for i in range(2): print(i)
28th Mar 2017, 2:23 PM
Tob
Tob - avatar
+ 3
ex: after writing numerical calculation, I write strings, then it doesnt give no output not rezult? If I write alone them so normally as everetime it works, gives rezult output
28th Mar 2017, 2:43 PM
Nasibillo Muhamedov
Nasibillo Muhamedov - avatar
+ 1
python idle will execute the code every time you hit the enter key. So yes you can only get one line in if you are using the main idle screen. However if you go up into file > new > project (i think off the top of my head) it will open a new page where you can type in a multi line program. When you go to run it it will run in to main idle screen
28th Mar 2017, 2:15 PM
Jason Hoffman
Jason Hoffman - avatar