lundi 9 octobre 2017

Random function in Python won't work

I'm trying to generate random sentences but it does not work, I already imported random and this is what I have:

    if "razor blade" in inventory:
        sentences = ("What do you take yourself for?","Are you insane?", "You are not doing that.", "You have to be joking.", "This isn't going to work.")
        num= random.randrange (0,5)
        print (sentences[num])
    elif "razor blade" not in inventory:
        print ("you don't own this item in your inventory.") 




Aucun commentaire:

Enregistrer un commentaire