Challenge: Tracking Step Goal Progress with if-else Statements
Task
Swipe to start coding
Your fitness tracker calculates how far the user is from their step goal. If the user has taken more than 90% of their step goal, display a congratulatory message. Otherwise, show how many steps are left to reach the goal.
- To compare if the user has reached 90% of the step goal, use
step_goal * 0.9
to calculate 90% of the goal. - If condition is met, set
result_more_than_90
toTrue
. - Otherwise, the remaining steps should be calculated.
- All print statements here are for testing your code.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 2. ChapterΒ 2
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: Tracking Step Goal Progress with if-else Statements
Swipe to show menu
Task
Swipe to start coding
Your fitness tracker calculates how far the user is from their step goal. If the user has taken more than 90% of their step goal, display a congratulatory message. Otherwise, show how many steps are left to reach the goal.
- To compare if the user has reached 90% of the step goal, use
step_goal * 0.9
to calculate 90% of the goal. - If condition is met, set
result_more_than_90
toTrue
. - Otherwise, the remaining steps should be calculated.
- All print statements here are for testing your code.
Solution
Everything was clear?
Thanks for your feedback!
Awesome!
Completion rate improved to 6.67SectionΒ 2. ChapterΒ 2
single