AttributeError:“员工”对象没有属性“ isheoverpaid”

时间:2019-10-31 07:14:47

标签: python-3.x attributes


AttributeError跟踪(最近一次通话)  在()中      29 def debit(deb):      30张('您的借方是',deb.debit) ---> 31名员工('raju','bangalore',200000,22,1).isheoverpaid()

AttributeError:“员工”对象没有属性“ isheoverpaid”


班级员工:     def init (个人,姓名,城市,薪水,年龄,经验):         self.name =名称         self.city =城市         自薪=工资         自我年龄=年龄         self.experience =经验

    def isheoverpaid(ip):
        if ip.experience < 5:
            if ip.experience*3*ip.experience*100000 > ip.salary:
                return 'yes'
            else:
                return 'no'
        else:
            if ip.experience*2.5*ip.experience*100000 > ip.salary:
                return 'yes'
            else:
                return 'no'

bank_customer(雇员)类:     def _init __(个人,姓名,城市,工资,年龄,经验,信用,借方):         员工。初始化(自己,姓名,城市,薪水,年龄,经验)         self.credit =信用         self.debit =借记

    def credit(cr):
        print('your credit is', cr.credit)

    def debit(deb):
        print('your debit is', deb.debit)

employee('raju','bangalore',200000,22,1).isheoverpaid()

0 个答案:

没有答案