Challenge: Weekly Habit Tracker
Task
Swipe to start coding
Write a function that summarizes a daily habit tracked over a week. The function should process a list of daily values representing the habit's occurrences for each day of the week.
- Calculate the sum of all values in
daily_values. - Calculate the average of the values in
daily_values. - Print the weekly total.
- Print the weekly average.
Solution
Everything was clear?
Thanks for your feedback!
Section 1. Chapter 5
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Suggested prompts:
Can you explain this in simpler terms?
What are the main points I should remember?
Can you give me an example?
Awesome!
Completion rate improved to 5.56
Challenge: Weekly Habit Tracker
Swipe to show menu
Task
Swipe to start coding
Write a function that summarizes a daily habit tracked over a week. The function should process a list of daily values representing the habit's occurrences for each day of the week.
- Calculate the sum of all values in
daily_values. - Calculate the average of the values in
daily_values. - Print the weekly total.
- Print the weekly average.
Solution
Everything was clear?
Thanks for your feedback!
Section 1. Chapter 5
single