错误:*:“ Payslip”和“ int”不受支持的操作数类型

时间:2019-12-26 14:25:56

标签: python oop

#finding pf on basic salary ie., 12% in basic salary
#the main function is fixed cann't modify u have to write ur code


class Payslip:
    def __init__(self,basicsla,hra,ita):
        self.basicsal = basicsal
        self.hra = hra
        self.ita = ita

class Payslipdemo:
    def __init__(self):
        self.k = 0
    def highestpf(self,l):
        self.k = max(l)
        o = (self.k*12)/100
        return o

if __name__ == "__main__":
    l = []
    count = int(input())
    for i in range(count):
        basicsal = int(input())
        hra = int(input())
        ita = int(input())
        l.append(Payslip(basicsal,hra,ita))
    payslipdemo = Payslipdemo()
    pf = payslipdemo.highestpf(l)
    print(pf)

0 个答案:

没有答案