dummy = 10
os.system("cls")
x = input("""You use your attack by chossing a attack,for now you have 3 attacks.
Choose one:
1)punch 3dmg
2)use knife 4dmg
3)use pistol 6dmg
""")
if x == 1:
dummy = dummy-3
print"Dummies life:"+str(dummy)
elif x == 2:
dummy = dummy-4
print"Dummies life:"+str(dummy)
elif x == 3:
dummy = dummy-6
print"Dummies life:"+str(dummy)
x=raw_input("""Attack:
1)punch 3dmg
2)use knife 4dmg
3)use pistol 6dmg
""")
if x == 1:
dummy = dummy-3
print"Dummies life:"+str(dummy)
elif x == 2:
dummy = dummy-4
print"Dummies life:"+str(dummy)
elif x == 3:
dummy = dummy-6
print"Dummies life:"+str(dummy)
if dummy <= 0:
os.system("cls")
elif dummy >= 0:
os.system("cls")
x=raw_input("Finish him write 1,2,3:")
#this is always printing help me#
if x==1:
dummy=dymmy-3
elif x==2:
dummy=dummy-4
elif x==3:
dummy=dummy-6
print"Good job!!!"
为什么总是打印最后一个 if elif 代码?
对不起,我不知道代码的其他部分是否有错误。