Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Building a Progress Tracker Using if-elif-else Statements | Mastering Python if-elif-else Statements
Conditional Statements in Python

bookChallenge: Building a Progress Tracker Using if-elif-else Statements

Task

Swipe to start coding

You're building a fitness challenge tracker that categorizes the user's effort based on their total weekly exercise time. The program should determine the correct category and provide appropriate feedback.

  • Use an if-elif-else structure to categorize the user's exercise time efficiently.
  • Assign "Super Achiever" if the user exercises for more than 10 hours in a week.
  • Assign "Hard Worker" if the user exercises for 6 to 10 hours, inclusive.
  • Assign "Getting There" if the user exercises for at least 3 hours but less than 6 hours.
  • Assign "Needs Improvement" if the user exercises for less than 3 hours.
  • Store the appropriate category in a variable title for later use.
  • Ensure all if, elif, and else statements end with a colon (:).

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 3. ChapterΒ 4
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

close

Awesome!

Completion rate improved to 6.67

bookChallenge: Building a Progress Tracker Using if-elif-else Statements

Task

Swipe to start coding

You're building a fitness challenge tracker that categorizes the user's effort based on their total weekly exercise time. The program should determine the correct category and provide appropriate feedback.

  • Use an if-elif-else structure to categorize the user's exercise time efficiently.
  • Assign "Super Achiever" if the user exercises for more than 10 hours in a week.
  • Assign "Hard Worker" if the user exercises for 6 to 10 hours, inclusive.
  • Assign "Getting There" if the user exercises for at least 3 hours but less than 6 hours.
  • Assign "Needs Improvement" if the user exercises for less than 3 hours.
  • Store the appropriate category in a variable title for later use.
  • Ensure all if, elif, and else statements end with a colon (:).

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 3. ChapterΒ 4
single

single

close

Awesome!

Completion rate improved to 6.67

bookChallenge: Building a Progress Tracker Using if-elif-else Statements

Swipe to show menu

Task

Swipe to start coding

You're building a fitness challenge tracker that categorizes the user's effort based on their total weekly exercise time. The program should determine the correct category and provide appropriate feedback.

  • Use an if-elif-else structure to categorize the user's exercise time efficiently.
  • Assign "Super Achiever" if the user exercises for more than 10 hours in a week.
  • Assign "Hard Worker" if the user exercises for 6 to 10 hours, inclusive.
  • Assign "Getting There" if the user exercises for at least 3 hours but less than 6 hours.
  • Assign "Needs Improvement" if the user exercises for less than 3 hours.
  • Store the appropriate category in a variable title for later use.
  • Ensure all if, elif, and else statements end with a colon (:).

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

some-alt