1
我写一个Python程序,我得到这个错误:属性错误:“诠释”对象有没有属性“选择”
Traceback (most recent call last):
File "C:\Users\Joe\SkyDrive\Documents\Python Project\Python\Forest path.py", line 28, in <module>
random = random.choice(accuracy)
AttributeError: 'int' object has no attribute 'choice'
下面是一个位的代码它指的是:
while health_1 > 0 and health > 0 and stamina > 0:
random = random.choice(accuracy)
if random != "0":
print("\n\n", random)
print("\nYou manage to hit the creature for", dmg, "damage!")
health_1 -= dmg
stamina -= stam_loss
print("The creature now has", health_1, "health")
print("\nThe creature hits you for 1 damage!")
health -= 1
print("Health:", health, "Stamina:", stamina,)
它做一次随机模块,然后生成错误 任何帮助表示赞赏。