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

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

肥皂起泡泡
浏览 145回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP