oldest_people = [122, 119, 117, 117, 116]  # Source: Wikipedia.org nth_person = int(input('Enter N (1-5): ')) if (nth_person >= 1) and (nth_person <= 5):     print('The {}nd oldest person lived {} years' \         .format(nth_person, oldest_people[nth_person-1])) 1. Modify the program to print the correct ordinal number ("1st", "2nd", "3rd", "4th", "5th") instead of "1th", "2th", "3th", "4th", "5th". 2. For the oldest person, remove the ordinal number (1st) from the print statement to say, "The oldest person lived 122 years".

Np Ms Office 365/Excel 2016 I Ntermed
1st Edition
ISBN:9781337508841
Author:Carey
Publisher:Carey
Chapter5: Working With Excel Tables, Pivottables, And Pivotcharts
Section5.3: Pivottable And Pivotchart
Problem 5QC
icon
Related questions
Question

oldest_people = [122, 119, 117, 117, 116]  # Source: Wikipedia.org

nth_person = int(input('Enter N (1-5): '))

if (nth_person >= 1) and (nth_person <= 5):
    print('The {}nd oldest person lived {} years' \
        .format(nth_person, oldest_people[nth_person-1]))

1. Modify the program to print the correct ordinal number ("1st", "2nd", "3rd", "4th", "5th") instead of "1th", "2th", "3th", "4th", "5th".
2. For the oldest person, remove the ordinal number (1st) from the print statement to say, "The oldest person lived 122 years".

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
JQuery and Javascript
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage