Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Making new lines of code
#1
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 :)
Reply
#2
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
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Regular Expression search to comment lines of code Gman2233 5 1,590 Sep-08-2022, 06:57 AM
Last Post: ndc85430
  I want to simplify this python code into fewer lines, it's about string mandaxyz 5 2,045 Jan-15-2022, 01:28 PM
Last Post: mandaxyz
Star I was making code for collision for my character izmamonke 2 2,054 Aug-06-2021, 04:30 PM
Last Post: izmamonke
  python seems to be skipping lines of code alansandbucket 1 4,086 Jun-22-2021, 01:18 AM
Last Post: Larz60+
  Running a few lines of code as soon as my timer ends nethatar 3 2,353 Feb-26-2021, 01:02 PM
Last Post: jefsummers
  Assistance with running a few lines of code at an EXACT time nethatar 5 3,165 Feb-24-2021, 10:43 PM
Last Post: nilamo
  Making a code.py file to function, does not run hobbyist 6 2,844 Jan-27-2021, 07:50 AM
Last Post: DeaD_EyE
  Repeating lines of code by an input Josh_Albanos 3 2,352 Oct-15-2020, 01:04 AM
Last Post: deanhystad
  Beginner: I need help understanding few lines of a code. hop_090 1 1,642 Sep-07-2020, 04:02 PM
Last Post: Larz60+
  How to split and combine embedded lines using less code pjfarley3 6 2,410 Aug-13-2020, 09:13 PM
Last Post: pjfarley3

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020