Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Optimisation
#1
Just a python noob wondering if there's a better method for delaying the order in which a program asks for an input, rather than just separating commands with ; for instance, in this simple program, the user is asked for the name of their favourite song, followed by the first, second, and third line of the song, and then this information is basically just printed back to them:

 song = input("What is your favourite song?\n");line1 = input("What\'s the first line?\n");line2 = input("And the second?\n");line3 = input("Finally, the third line?\n");print(f"\n{song}\n{line1},\n{line2},\n{line3}")
As you can see here, I have everything on one line separated with a semicolon (;), as if I was to press enter it would of course execute the line of code so far. Is there another way to separate commands like this without having everything on the same line?
Reply


Messages In This Thread
Optimisation - by H0M1C1D4L_P1G - Dec-23-2019, 06:51 PM
RE: Optimisation - by buran - Dec-23-2019, 09:18 PM
RE: Optimisation - by H0M1C1D4L_P1G - Dec-23-2019, 11:32 PM
RE: Optimisation - by ichabod801 - Dec-23-2019, 11:44 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Help Getting Started - Optimisation Problem lummers 1 1,739 Sep-19-2020, 05:05 AM
Last Post: perfringo
  Optimisation problem - star identification pberrett 1 2,263 Apr-01-2019, 12:17 AM
Last Post: scidam

Forum Jump:

User Panel Messages

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