Python Forum
How to make input goto a different line
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to make input goto a different line
#3
Although Larz+ is right and this is a good place to use a dictionary I'm very surprised at your "not finding anything" comment as this is a classic use case for the "if" statement:

tax = None
county = "Franklin" 

if county == "Springfield":
    tax = 0.075
elif county == "Franklin":
    tax = 0.05
elif county == "Riverside":
    tax = 0.032
else:
    tax = 0.40

print(tax)
"So, brave knights, if you do doubt your courage or your strength, come no further, for death awaits you all with nasty, big, pointy teeth!" - Tim the Enchanter
Reply


Messages In This Thread
How to make input goto a different line - by mxl671 - Feb-03-2020, 09:35 PM
RE: How to make input goto a different line - by Marbelous - Feb-04-2020, 07:12 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Receive Input on Same Line? johnywhy 8 776 Jan-16-2024, 03:45 AM
Last Post: johnywhy
  how to make sure an input is from the wanted type astral_travel 16 2,541 Oct-31-2022, 04:11 PM
Last Post: astral_travel
  How to make for loop display on 1 Line Extra 3 1,479 Jan-12-2022, 09:29 PM
Last Post: Extra
  How to input & output parameters from command line argument shantanu97 1 2,606 Apr-13-2021, 02:12 PM
Last Post: Larz60+
  How to make input come after input if certain line inserted and if not runs OtherCode Adrian_L 6 3,372 Apr-04-2021, 06:10 PM
Last Post: Adrian_L
  goto jmabrito 34 10,455 Feb-18-2021, 09:55 PM
Last Post: jmabrito
  Multi-line console input lizze 4 2,409 Dec-26-2020, 08:10 AM
Last Post: lizze
  Make the answer of input int and str enderfran2006 2 2,031 Oct-12-2020, 09:44 AM
Last Post: DeaD_EyE
  bad input line 3 how t fix it youssef210 2 2,733 Aug-27-2020, 04:57 PM
Last Post: nilamo
  Line charts error "'isnan' not supported for the input types," issac_n 1 2,440 Jul-22-2020, 04:34 PM
Last Post: issac_n

Forum Jump:

User Panel Messages

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