lundi 28 décembre 2020

I'm practicing my if, elif, else and for some reason it's not working? [closed]

Here is the code that is not working:

import random 

a = int (input ("请输入一或者二"))
d = a

b = random.randint(1,2)

if a != b:
    print ("你被狮子吃掉了")

c = random.randint(1,2)

elif d != c:
    print ("你被龙吃掉了")
    
else:
    print("你活下来了")

Aucun commentaire:

Enregistrer un commentaire