samedi 31 mars 2018

Issue with multiple if statements with different outcomes giving the same outcome everytime [duplicate]

This question already has an answer here:

this is probably a very simple answer but I am having a problem with the choice1() function in my program. I am making a text adventure game in python to help with GCSE revision and can't get past this problem. I have looked for an answer on the site but haven't found what I was looking for. I have had trouble copy and pasting the code into the site so instead i have put a link to an image of it below:

https://i.stack.imgur.com/5ZDEB.png

As you can see choice1() doesn't work properly. When i type 'Weapon' the character should break of the chair leg, when i type 'Fists' He should not and when i type something else it should say that the input is invalid and ask the question again. So in conclusion I need a way for the if, elif, else statements to have the correct outcome. Again i am quite new to python so sorry if this is a stupid question, thank you in advance!

Aucun commentaire:

Enregistrer un commentaire