Question 20: If Elif Else

Write a Python program to check the type of day a student will have based on the number of homework tasks they completed.

  1. Start by asking for the student’s name and store it in a variable called name.
  2. Ask how many homework tasks they have completed and store it in a variable called completed_tasks (as an integer).
  3. Use an if-elif-else structure to check the following:
    • If completed_tasks is 10 or more, print:
      "Excellent work, [name]! You completed [completed_tasks] tasks. You can enjoy a free day!"
    • If completed_tasks is between 5 and 9 (inclusive), print:
      "Good job, [name]! You completed [completed_tasks] tasks. You’re on track!"
    • If completed_tasks is between 1 and 4 (inclusive), print:
      "Keep going, [name]! You completed [completed_tasks] tasks. A little more effort will pay off!"
    • If completed_tasks is 0, print:
      "Don't give up, [name]! Start working on your tasks. You can do it!"
Write what you are looking for, and press enter to begin your search!