I want to make a Person class containing first_name
and last_name
attributes that are passed into the __init__
method. I then want to add a property called full_name
that returns the first and last names together with a space between them. I then also want to add a property called name
that returns the names together in the format of last name, followed by a comma and a
space, followed by the first name.
An example output is below.
from Code4 import Person
teacher = Person("D", "C")
teacher.last_name
'C'
teacher.full_name
'D C'
teacher.name
'C, D'
I am confused on how to write the code for this sort of output.