samedi 19 janvier 2019

my code will not exicute the if/ elif part in this

so When I run this code(a portion of it) and I get to the word = input, it will run that and let me input my answer. But instead of doing the if / elif code, it will say exit code 0. I do not understand why this is happening so please help. I tried to remove code here and there but it changed nothing.

rand1 = random.randint(1, 2)
rand2 = random.randint(1, 4)
rand = random.randint(1, 1)
word = input("use a word that is 1-10 letters on a space, type a number 1 -    100 for the space: ")
if rand == "1":
    print("randomly generating")
elif rand1 == "1":
    a1 = word[0]
    a2 = word[1]
    a3 = word[2]
    a4 = word[3]
    a5 = word[4]
    a6 = word[5]
    a7 = word[6]
    a8 = word[7]
    a9 = word[8]
    a10 = word[9]
    letters()

this is just a portion as the entire code is too long to post in here

Aucun commentaire:

Enregistrer un commentaire