Python Forum
How to make input come after input if certain line inserted and if not runs OtherCode
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to make input come after input if certain line inserted and if not runs OtherCode
#1
How can I make an input come after another input if a certain piece of text is inputed and if not it prints something else? My current code:
username = input("username>")
if username == "adrian":
    password = input("password>")
    if password == "password1":
        print("login sucsessfull")
         
    else:
        print("password incorrect.")
else:
    print("username incorrect")
But all I get is: "Process finished with exit code 0" and nothing else.
Reply


Messages In This Thread
How to make input come after input if certain line inserted and if not runs OtherCode - by Adrian_L - Mar-30-2021, 10:30 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Input error correction. shakoun 1 112 May-30-2024, 09:10 AM
Last Post: Gribouillis
  problem program runs in a loop jasserin 0 173 May-18-2024, 03:07 PM
Last Post: jasserin
  Keep getting "SyntaxError: incomplete input" but can't see why. Pedroski55 3 540 May-14-2024, 07:46 AM
Last Post: gavin34
  Waiting for input from serial port, then move on KenHorse 3 1,365 Apr-17-2024, 07:21 AM
Last Post: DeaD_EyE
  Help with to check an Input list data with a data read from an external source sacharyya 3 578 Mar-09-2024, 12:33 PM
Last Post: Pedroski55
  difference between forms of input a list to function akbarza 6 1,220 Feb-21-2024, 08:02 PM
Last Post: bterwijn
  pyaudio seems to randomly halt input. elpidiovaldez5 2 481 Jan-22-2024, 09:07 AM
Last Post: elpidiovaldez5
  Receive Input on Same Line? johnywhy 8 923 Jan-16-2024, 03:45 AM
Last Post: johnywhy
  manually input data jpatierno 0 408 Nov-10-2023, 02:32 AM
Last Post: jpatierno
  Using string input for boolean tronic72 3 815 Nov-01-2023, 07:48 AM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

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