I’m a beginner and I’ve been struggling with this. I want the other inputs to stop running if the user isn’t Chai or 35. When I run it even if the person isn’t meeting conditions it continues.
<code>user = input("What is your name? n")
if user == "Chai":
age = int(input("Oh really? How old are you? n"))
if age <= 34:
print("Lmao nice try kiddo")
elif age >= 100:
print("uh GTFO Dracula!")
elif age == 35:
name = input("Welcome back! Who's info do you need saved? n")
elif age >= 36:
print("Bye Felcia!")
elif user == "Boots":
print("pspspsp here kitty!")
else:
print("Access Denied")
# Inputs here
note = input("What note do you want here? n")
bday = input("What is their birthday or zodiac sign? n")
</code>
<code>user = input("What is your name? n")
if user == "Chai":
age = int(input("Oh really? How old are you? n"))
if age <= 34:
print("Lmao nice try kiddo")
elif age >= 100:
print("uh GTFO Dracula!")
elif age == 35:
name = input("Welcome back! Who's info do you need saved? n")
elif age >= 36:
print("Bye Felcia!")
elif user == "Boots":
print("pspspsp here kitty!")
else:
print("Access Denied")
# Inputs here
note = input("What note do you want here? n")
bday = input("What is their birthday or zodiac sign? n")
</code>
user = input("What is your name? n")
if user == "Chai":
age = int(input("Oh really? How old are you? n"))
if age <= 34:
print("Lmao nice try kiddo")
elif age >= 100:
print("uh GTFO Dracula!")
elif age == 35:
name = input("Welcome back! Who's info do you need saved? n")
elif age >= 36:
print("Bye Felcia!")
elif user == "Boots":
print("pspspsp here kitty!")
else:
print("Access Denied")
# Inputs here
note = input("What note do you want here? n")
bday = input("What is their birthday or zodiac sign? n")
I was expecting the other inputs to stop appearing after first two didn’t match up to Chai and 35.
New contributor
Chai Moon Tea is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.