class Phone:
def __init__(self,name,model,colour,money):
self.name=name
self.model=model
self.colour=colour
self.money=money
def __str__(self):
return "名称:%s ,型号:%s,颜色:,%s,价格:%s"%(self.name,self.model,self.colour,self.money)
def call(self):
print("正在使用%s %s 打电话"%(self.name,self.model))
def music (self):
print("正在使用%s %s 听音乐" %(self.name,self.model))
if __name__ == '__main__':
phone=Phone("小米","8","土豪金","2300")
print(phone)
phone.call()
phone.music()