I am trying to write a function that asks the user how many days of sleep he wants to report, then according to the answer it should ask for the day of the week and the hours slept. The function must return a list of lists with the days of the week and the amount of hours the user reported sleeping.
So, if I call
print(healthy())
"How many days do you want to report?" : 3
Day of the week: Monday
Hours slept: 6
Day of the week: Tuesday
Hours slept: 8
Day of the week: Wednesday
Hours slept: 7
Then it should print, a list of list with the information of the user:
[['Monday', 6], ['Tuesday', 8], ['Wednesday', 7]]
So far I have:
def healthy():
record = []
days = int(input("How many days do you wanna report?: "))
DofW = input(str("which day?"))
Hr = int(input("how many hours?"))
for i in range(days):
record.append(DofW)
record.append(Hr)
print(record)
but this is not giving what I want. Pls help!