Question 22: If Elif Else

Write a Python program to classify a person’s physical activity level based on the number of steps they walked in a day.

  1. Ask for the person’s name and store it in a variable called name.
  2. Ask how many steps they walked and store it in a variable called steps (as an integer).
  3. Use an if-elif-else structure to determine their activity level:
    • If steps is 20,000 or more, print:
      "Incredible, [name]! With [steps] steps, you're a superstar walker!"
    • If steps is 10,000 or more but less than 20,000, print:
      "Great job, [name]! With [steps] steps, you're staying active and healthy!"
    • If steps is less than 10,000 but greater than 0, print:
      "Keep it up, [name]! With [steps] steps, you're making progress. Aim for 10,000 next time!"
    • If steps is 0, print:
      "Come on, [name]! You haven't walked any steps today. Time to get moving!"
Write what you are looking for, and press enter to begin your search!