Hi!
I am new to Python and trying to practice if/else statements. Going OK, and the code gets executed, however, there is one block that does not work the way I want to, but I cannot figure out why. I want the player to choose a weapon, the options are a machete or a morningstar, but it won’t print the syntax after the if statement despite the chosen option is a machete.
If it makes any difference, I am trying nested if statements.
weapon_of_choice = input("You have an option to choose a weapon. machete or morningstar?")
if weapon_of_choice == "machete":
print("Good choice! Your machete is named Rolf.")
else:
print("Ahh you slayer! Your morningstar only listens to you, and its name is Rosa.")
The code executes fine, but it will print the “Ahh you slayer” regardless if the input is machete or Morningstar. I do not understand why.
I appreciate any help!!