Basic formatting
Input
Contact('john','doe').display_name
Output
John Doe
Both parts are trimmed and title-cased, then joined with a space.
Full lesson preview
Learn how to use the @property decorator to expose a computed, read-only attribute that formats instance data for display.
Problem statement
Task
Examples
Input
Contact('john','doe').display_name
Output
John Doe
Both parts are trimmed and title-cased, then joined with a space.
Input format
Output format
Constraints
Samples
Input
Contact(' mary ','ANN ').display_name
Output
Mary Ann
Leading/trailing whitespace removed and both parts title-cased.