class num1():
def lucky(self):
print(‘你的幸运数字是’+str(self.xx)+’,我把它翻888倍还给你!’+str(self.xx888))
def lucky1(self):
print(‘我重写了程序!/n你的幸运数字我给你翻666倍’+str(xx666))
xx=int(input(‘请输入您的幸运数字:’))
s=num1()
s.lucky()
num1.lucky=lucky1
s.lucky()
代码错误原因:‘num1’ object has no attribute ‘xx’
为什么‘num1’不匹配?求大佬支援,小白已经阵亡。。。。。。。
'numm' object has no attribute 'xx'
最新推荐文章于 2024-03-21 12:46:15 发布