Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
input variable choice
#6
You are asking your user to enter "police academy" or "corner lookout". This would be quite difficult for your user because you provide no info about what is a valid answer. I think what you want to do is ask them to enter "good" or "bad", and print "police academy" or "corner lookout".
if input("Are you good or bad? ").lower() in ("good", "g"):
    print("Police Academy"
else:
    print("Corner Lookout")
Reply


Messages In This Thread
input variable choice - by MCL169 - Feb-19-2023, 06:54 PM
RE: input variable choice - by noisefloor - Feb-19-2023, 07:01 PM
RE: input variable choice - by MCL169 - Feb-19-2023, 08:08 PM
RE: input variable choice - by menator01 - Feb-19-2023, 07:05 PM
RE: input variable choice - by MCL169 - Feb-19-2023, 08:01 PM
RE: input variable choice - by deanhystad - Feb-19-2023, 08:55 PM
RE: input variable choice - by MCL169 - Feb-19-2023, 09:00 PM
RE: input variable choice - by MCL169 - Feb-19-2023, 08:59 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  combobox_callback(choice choice part of openfile name (kind of dependency) janeik 9 1,608 Sep-10-2023, 10:27 PM
Last Post: janeik
  How to include input as part of variable name Mark17 4 2,619 Oct-01-2021, 06:45 PM
Last Post: Mark17
  trying to input a variable using random.choice python63 9 3,811 Aug-13-2020, 05:37 PM
Last Post: python63
  Would like to input a date variable and determine whether it is within the time range harold 3 2,670 Jan-05-2019, 09:04 AM
Last Post: Gribouillis
  Mixed string,Integer input variable issue maderdash 2 2,833 Nov-06-2018, 09:46 AM
Last Post: snippsat
  Save User Input From LineEdit Box To Variable digitalmatic7 2 8,472 Nov-22-2017, 05:34 PM
Last Post: digitalmatic7
  input defines variable but it's not defined tozqo 5 7,437 Jun-05-2017, 02:45 AM
Last Post: tozqo
  Taking user input and storing that to a variable then storing that variable to a list jowalk 12 37,564 Mar-27-2017, 11:45 PM
Last Post: wavic

Forum Jump:

User Panel Messages

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