Python Cancel Print
Hello, I just started messing around with Python today and was kind of confused on how to make this code not print "You may pass, " when input "Peter" is entered by the user. When the input "Peter" is used it prints what I would like it to "You shall die, Peter" but I would like it to only print that and not "You may pass," as well.
Example 1:
Halt!
Who goes there? Random Name
You may pass, Random Name
Example 2:
Halt!
Who goes there? Peter
You may pass, Peter
You shall die, Peter
The Code ↓
print("Halt!")
user_input = input("Who goes there? ")
print("You may pass,", user_input)
if user_input == "Peter":
print("You shall die,", user_input)
else: print