Python Forum

Full Version: Making new lines of code
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there!

Sorry about the lame question but I just started using python and am wondering how to make a new line like
this without it running the code. Any ideas? I'm using Python 3.9.1 btw :)
Your question is quite vague, but I guess you are using python interactive shell. That is when you have >>> at the start of the line. Interactive mode is useful for experiments, but as you discovered every line is evaluated when you hit enter (loops, ifs and similar a bit different).
Normally you would write your code in IDE (or any text editor) and save it as python file with .py extension
then you execute that script.

Read https://python-forum.io/Thread-How-to-Ex...ython-code