The Chart

Numbers are useful, but a picture shows the week at a glance. Finish the report with a chart: one line for each day, with the day's name and a bar of # characters, one for every full 1000 steps. 6200 steps make 6 characters: the extra 200 steps don't make another thousand.

Longest streak: 2 days
Mon ######
Tue ########
Wed ##########
Thu #######
Fri ############
Sat ###############
Sun ##

A tip: remember the multiplication table from the exercise on nested loops. print(..., end=" ") ended with a space instead of a new line, so the next print() continued on the same line. With end="", print() ends with nothing at all.

That's the whole report. Your program goes through a week of data, finds the total, the average, the best day and the longest streak, and draws a chart, all with lists, loops and conditions. In the next lesson, on functions, you'll learn to give a piece of code a name and use it again whenever you need it. One function could then draw the chart for any week.

Instructions

Print the chart below the report.

Start programming for free

By signing up, you agree to the Terms of Service and Privacy Policy.

Or sign up with:

3/3