【发布时间】:2017-12-09 19:39:21
【问题描述】:
错误 selfpoints += cardPoints UnboundLocalError:赋值前引用了局部变量“selfpoints”
class userpoint_status:
def __init__():
selfpoints = 0
def increase_points():
self.points += cardPoints
print("You have",selfpoints,"points")
if selfpoints > 21:
lose_game()
【问题讨论】:
标签: python python-3.x