Patients

Report a typo

The class Patient needs both an unambiguous representation for developers and a readable string for users. Here's how they are supposed to look:

  • For developers: Object of the class Patient. name: {name}, last_name: {last_name}, age: {age}
  • For users: {name} {last_name}. {age}

For example, for object john = Patient("John", "Doe", 50) these representations would respectively look like this:

  • Object of the class Patient. name: John, last_name: Doe, age: 50
  • John Doe. 50

Create the necessary methods below. Pay attention to spaces and punctuation in the strings.

Tip: Unambiguous representation can be defined within __repr__.

Write a program in Python 3
class Patient:
def __init__(self, name, last_name, age):
self.name = name
self.last_name = last_name
self.age = age

# create methods here
___

Create a free account to access the full topic