4 Answers
+ 5
Go to file >new file
Now write your code and save your file
Click on run or F5
Now your multiple line code is executed
+ 2
What do you mean exactly? You mean you cant type multiple lines and then run? It just runs every line one at a time when you type them?
+ 2
Hi!
When you write your code in Python you must write it so you can run the code from a module. Normally this is a text file; you write it with some kind of text editor, save the file with the .py extension and run the code. Then you can jump between the lines while you write your program.
But you can also write your code from the interactive prompt. This is actually a module too, but with the difference that it prints the result from your inputed code, and donât save it. Otherwise it act like a ordinary module.
This makes the interactive prompt difficult to use, if you want to write long programs, as you run each line every time you push enter. And you have to rewrite the hole body in compound statemend like a loop, for example, if you for instance make an syntax error. So the interactive promtpt is better for testing small code bits.
Otherwise I recommened you use a text editor, like Pythons IDLE, from where you can write, edit, save and run your code, as many times as you like.
Regards /Per B