 Challenge: Simplifying Fitness Tracker Logic
Challenge: Simplifying Fitness Tracker Logic
Task
Swipe to start coding
You're building a fitness tracker app that provides motivational messages when users reach their fitness goals. Currently, the logic is cluttered with multiple if statements, and it's your job to simplify it.
- Combine the two conditions into a single ifstatement.
- Use the oroperator to check if at least one of the conditions is met.
- Ensure result_messageis updated only once inside the if block.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 1. ChapterΒ 6
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Awesome!
Completion rate improved to 6.67 Challenge: Simplifying Fitness Tracker Logic
Challenge: Simplifying Fitness Tracker Logic
Swipe to show menu
Task
Swipe to start coding
You're building a fitness tracker app that provides motivational messages when users reach their fitness goals. Currently, the logic is cluttered with multiple if statements, and it's your job to simplify it.
- Combine the two conditions into a single ifstatement.
- Use the oroperator to check if at least one of the conditions is met.
- Ensure result_messageis updated only once inside the if block.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 1. ChapterΒ 6
single