← Back to challenges

Fullname and Email

PythonHardclassesobjectsstringslanguage_fundamentals

Instructions

Create the instance attributes fullname and email in the Employee class. Given a person's first and last names:

  • Form the fullname by simply joining the first and last name together, separated by a space.
  • Form the email by joining the first and last name together with a . in between, and follow it with @company.com at the end. Make sure the entire email is in lowercase.

Examples

emp_1 = Employee("John", "Smith")
emp_2 = Employee("Mary",  "Sue")
emp_3 = Employee("Antony", "Walker")
emp_1.fullname ➞ "John Smith"

emp_2.email ➞ "[email protected]"

emp_3.firstname ➞ "Antony"

Notes

  • The attributes firstname and lastname are already made for you.
python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Scottish Screaming