Solution: Extend class "User" to our needs
Completion requirements

UML class and object diagram
The code is devided here into two files.
Good practice is to outsource class definitions into a separate file that has the same name as the class itself:
User.py
class User: # class definition
def __init__(self, surname, firstname, dateOfBirth): # constructor
self.__surname = surname # private properties/attributes
self.__firstname = firstname
self.__password = firstname[0] + surname[0] + dateOfBirth # assembling of initial password
self.__dateOfBirth = dateOfBirth
self.__username = surname
def getSurname(self): # getter methods
return self.__surname
def getFirstname(self):
return self.__firstname
def getPassword(self):
return self.__password
def getDateOfBirth(self):
return self.__dateOfBirth
def getUsername(self):
return self.__username
The creation of objects and method calls in a second file:
testUser.py
from User import User # Import from User.py in same directory the class User
user1 = User("Miller","Sam","22.11.2004") # Creation of objects user1 and user2
user2 = User("Smith","Jake","13.02.2003")
print(user1.getPassword()) # call of methods and output of return values
print(user2.getUsername())
The output
SM22.11.2004
Smith
Last modified: Monday, 21 October 2019, 10:35 AM