I am having the user input an allergy symptom and tell the user that the symptom is an allergy symptom, if the symptom is in the tuple and if its not then it'll tell them "not an allergy symptom. I had tried using a tuple and wrote "if user_input == "tuple_name":", but it didn't work. Is there a way to do this? If the tuple doesn't work, is there a way to make the if else statements shorter?
This is the tiny program so far:
# most common questions asked by patients at pharmacy
# allergy treatment
def symptoms(allergies):
while True:
user_input = input("enter symptom: ")
if user_input == "runny nose":
print("allergy symptom")
elif user_input == "itchy throat":
print("allergy symptom")
elif user_input == "watery eyes":
print("allergy symptom")
elif user_input == "itchy nose":
print("allergy symptom")
elif user_input == "trouble breathing":
print("this is a severe allergic reaction. Call 911!")
break
elif user_input == "hives":
print("this is an allergic reaction")
elif user_input == "rash":
print("this is an allergic reaction")
elif user_input == "throat closing":
print("this is a severe allergic reaction. Call 911!")
break
elif user_input == "swelling":
print("this is an allergic reaction")
else:
print("not an allergy symptom.")
symptoms('allergies')
# Rph recommended otc products for mild allergic reactions and for allergies
def allergy_otc():
while True:
pt_otc_age = input("Is the patient younger than 12 years old? ")
if pt_otc_age == "yes":
print("Recommended: Children's Zyrtec, Claritin, Allegra, & Benadryl")
else:
print("Recommended: Claritin, Zyrtec, Allegra, & Benadryl")
pt_pregnancy_status = input("Is the patient pregnant? ")
if pt_pregnancy_status == "yes":
print("Recommended allergy medication for pregnant women would be Claritin.")
else:
break
allergy_otc()