Python program to find the elder person of two persons.
Problem Description: We need to get input from users for the name and age of two persons. And then return the elder person's name and age.
Steps to find the sum of distances:
- Step 1: Create a class named Person with methods to get data, print data and return the older person's details.
- Step 2: GetPerson() method takes input from users i.e. name and age of person.
- Step 3: PutPerson() method prints the data of the object.
- Step 4: For the person's information, compare their ages and return the person's information with more age.
Program to illustrate the program
Output:
need an explanation for this answer? contact us directly to get an explanation for this answer