为了账号安全,请及时绑定邮箱和手机立即绑定

下面这个python程序哪里有问题阿总报错

下面这个python程序哪里有问题阿总报错

肥皂起泡泡 2018-07-16 10:09:55
1 #!/usr/sbin/env python                                                        2 #from new import *   3   4 class worker:  5     def __int__(self, name, pay):  6         self.name = name  7         self.pay = pay  8     def lastname(self):  9         return self.name.split()[-1] 10     def giveRaise(self, percent): 11         self.pay *=(1.0 + percent) 12 bob = worker('Bob Smith',50000) 13 sue = worker('sue leaf',50000) 14 bob.lastname() 15 sue.lastname() 16 sue.giveRaise(.10) 17 sue.pay[root@server1 ~]# python old.py Traceback (most recent call last):  File "old.py", line 18, in <module>    bob = worker('Bob Smith',50000)TypeError: this constructor takes no arguments
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 127 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信