I’m trying to write a basic choice system, though I am having issues.
PChoice = input("What is your choice?: ")
RootChoice = input("Are you sure?:")
if input == "yes" or "Yes":
if RootChoice == "no" or "No":
print("Please choose again")
print("You Chose " + PChoice)
I can’t seem to figure out how to get it to only print either the yes line or no line (You chose, Please choose again)
I’m sorry if this is basic, This is my first solo developing project.
I was trying to write code that would print one option if chosen, I tried to write a if not command but that didn’t work.
New contributor
Boxcel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2
PChoice = input("What is your choice?: ")
RootChoice = input("Are you sure? (yes/no): ").lower()
if RootChoice == "yes":
print("You chose " + PChoice)
elif RootChoice == "no":
print("Please choose again")
else:
print("Invalid response. Please answer 'yes' or 'no'.")