O'Reilly logo
  • Longxiang Lyu thinks this is interesting:

9-3. Users:

From

Cover of Python Crash Course

Note

class User(object):
"""describe user"""
def init(self, first, last, age, gender, marry='single'):
self.first = first.lower()
self.last = last.lower()
self.age = age
self.gender = gender.lower()
self.marry = marry.lower()

def describe_user(self):
    print('Name: ' + self.first.title() + self.last.title())
    print('Age: ' + str(self.age))
    print('gender: ' + self.gender)
    print('marry status: ' + self.marry)

def greet_user(self):
    message = 'It is such a pleasure to meet you, '
    if sel...