+ 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
4 Réponses
+ 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.
+ 3
@Jason Hoffman: You can get more than one line in the shell. Just try
for i in range(2):
print(i)
+ 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
+ 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