import random
x = randint(1, 10):
if x ==(1):
print ("yay")
MathDragon.getsHit()
MathDragon.sayHealth()
else:
print ("no")
MathDragon.sayHealth
from random import randint
x = randint(1, 10)
if x == 1:
print ("yay")
MathDragon.getsHit()
MathDragon.sayHealth()
else:
print ("no")
MathDragon.sayHealth
Python是一种“缩进语言”-您的制表符/ 4个空格很重要。
而且,在x赋值后加上其他错误,不需要冒号-参见上文