题解 | #修改属性1#
修改属性1
https://www.nowcoder.com/practice/c5ab441e5e8f4ec7bf36ba51a3141340
class employee:
def __init__(self,name,salary,age=-1):
self.name=name
self.salary=salary
self.age=age
def printclass(self):
if self.age==-1:
print("Error! No age")
else:
print("{}'salary is {}, and his age is {}".format(self.name,self.salary,self.age))
a=input()
b=int(input())
c=int(input())
e=employee(a,b)
e.printclass()
e.age=c
e.printclass()
