Question: Part 3 : Average Steps Calculator ( 5 0 % ) A personal fitness tracker keeps track of the number of steps the wearer takes
Part : Average Steps Calculator
A personal fitness tracker keeps track of the number of steps the wearer takes each day. The online component of the product allows the user to download a file containing daily step data.
Attached is a file named steps.txt It contains the number of steps a user took every day. The first entry is January all the way through to December Presume days in February
Write a program to analyze the steps taken to show:
Average steps taken each month
Most steps taken each month
Your program should:
Use named constants for the number of days in each month
ie: JANUARY FEBRUARY etc.
Use a variable for each month this should be a list
ie: jansteps febsteps etc
Remember you can initialize a list using
Use a function named stepsread to generate the step list for each individual month
Your function should accept values as arguments the file variable and the number of days in the month
Use a for loop in the function that reads one line of steps at a time readline method
Function should return a single LIST of all the lines steps for that particular month
You will need to call this function times!
Use a separate function named statscalc to calculate the average and max steps taken for a month
Your function should accept the list generated from the above function for a month's steps as an argument.
Hint: You can use sum, max, and len builtin list functions to calculate the monthly average and most steps taken for a day in a month.
Function should return values: the average and max steps to your main program
HINT: Use the read position to your advantage. It always remembers the next line to be read.
BONUS!
BONUS #: Worth up to additional points
Determine the date day of the respective month the maximum steps were taken
Hint: indexes start at zero, not one.
BONUS #: Worth up to additional points
Concatenate your lists to calculate: highest, lowest and average step totals all year
Do this using a separate function and return the proper values to your main or no bonus points will be given
Software requirements for ALL Python code parts:
Use comments at the top of your program to indicate your name, name of your program and a short description of what the program does
Store any values used in calculations as variables or named constants
All output should use FStrings only
No calculations inside output statements
Comment the meaning of all variables and functions when they are created
All input requests should be userfriendly with correct grammar and spacing before the input area
Format all numerical output in appropriate formats use integer or decimal with appropriate places
Do not use global variables! This also means no variables outside of main
If you write a function, you must pass the required values into your function and use a return statement to return the appropriate values back to the line of your program that called the function
If we have not yet learned a particular statement, you are not able to use it and will receive a zero for that entire part of the lab
Submit a valid python file named as requested. Do not submit output from the interactive shell.
steps.txt
