class User:
def __init__(self, last_name, first_name, age, height, weight):
self.last_name = last_name
self.first_name = first_name
self.age = age
self.height = height
self.weight = weight
def describe_user(self):
print(
"{0}{1}的基本信息为:年龄:{2},身高:{3},体重:{4}".format(self.last_name, self.first_name, self.age, self.height, self.weight))
def greet_user(self, content="海门人!"):
print("{}{},{}".format(self.last_name, self.first_name, content))
u1 = User('沈', '亮', '28', '178', '135')
u2 = User('张', '莹莹', '30', '163', '96')
u3 = User('刘', '唐', '30', '180', '140')
u1.describe_user()
u1.greet_user("你好美呀!真励志!")
print()
u2.describe_user()
u2.greet_user("你今天怎么啦?嗓音有点不对劲!")
print()
u3.describe_user()
u3.greet_user()
print()