Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Weekly Habit Tracker | Everyday Calculations and Automation
Python for Daily Tasks

bookChallenge: 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?

How can we improve it?

Thanks for your feedback!

Section 1. Chapter 5
single

single

Ask AI

expand

Ask AI

ChatGPT

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?

close

bookChallenge: 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

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 1. Chapter 5
single

single

some-alt