I'm quite new to Python, and need help with a simple code.
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
"Your bare hands were not strong enough, and you were killed. Returning to menu!".
Could someone help out?
------------------------------------------------------------------------------------
axe = False sword = FalseHere are the starting variables for wether user has an axe or a sword.
------------------------------------------------------------------------------------
if q2a == "1": sword = True if q2a == "2": axe = TrueHere is where they are changed to True, to indicate that user has one.
------------------------------------------------------------------------------------
if sword == True: print("You slash off the wolves head before it attacks you, killing it.") print("You have,",health,"remaining") elif axe == True: print("The wolf bites you once and you swing your axe at the wolf, cutting it clean in half.") health = health - 20 print("You have,",health,"remaining") else: print("Your bare hands were not strong enough, and you were killed. Returning to menu!")Here, even if sword or axe is set to True, it always ends up with:
"Your bare hands were not strong enough, and you were killed. Returning to menu!".
Could someone help out?