Problem here about input output? i guess

So here i have this pile of code :

answer = input ("<>What ya gonna attack him with? (" + Current_Melee_Weapon + "//" + Current_Ranged_Weapon + ") : ").lower().strip()

i setted Current_Melee_Weapon to "Army Knife"
and further more , the code after the pile of code will be:

if answer == Current_Melee_Weapon:
    print ("You attacked him with the " + Current_Melee_Weapon + " ..."

but when i inputted “Army Knife” into the terminus build system, the code doesnt run and just ends where i inputted…
So my question here is, is there any way to let the if answer == Current_Melee_Weapon: part work so that it runs?

Hello @igniteus and welcome to the Codecademy Forums!

If you set Current_Melee_Weapon to "Army_Knife", and input “Army Knife,” what do you think will happen? Right now your if statement does not evaluate to true. Can you see why?

1 Like

oh sorry typo error , but its the post that has the error , sorry if this confused you but no, its not this problem i think

You used .lower() in your program to format the user’s input. How do you think that will affect whether the if statement is True or False?

it will auto turn all my input into lower() form? i honestly dont think this is the problem cause i have been using the same format here in other codes that i didnt show here in the same file

If you use .lower() to format answer, answer = "army knife". However, when comparing answer == Current_Melee_Weapon, you are comparing "army knife" == "Army Knife".

I also noticed that there’s a space between input and the bracket that’s supposed to follow input. I’m not sure if that will have any effect on how your code runs but maybe also try removing that space?

1 Like

ok i will try that in a second thanks for helping

1 Like

Thanks! It worked ! !!!

No problem! Glad it worked!