subject

Peyton is taking a part-time job to earn some extra money. Every week the manager will provide a list of tasks and the number of hours each task requires. The tasks have to be done one by one from the first one and Peyton would do so until the time spent on all finished tasks exceeds 10 hours. Please construct a function take_tasks, which takes one integer list as the argument task_hours and prints out how many hours and how many tasks Peyton would do for that week. For example, the program below tasks ([2, 1, 3, 1, 4, 2, 3])
will have the following output:
Finish 5 tasks in 11 hours
Note: you can use enumerate() to get the index of the task, which is available after the for loop terminates. However, keep in mind that index starts from 0.
time_spent = 0
time_spent = 10
if time_spent > 10: break
if time_spent > 0: break
for index, hour in task_hours:
print('Finish {} tasks in {} he
if time_spent == 10: break
def take_tasks (task_hours):
time_spent += index
time_spent += hour
for index, hour in enumerate

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 06:30
Selective incapacitation is a strategy to reduce prison population
Answers: 3
question
Computers and Technology, 23.06.2019 11:30
Which excel file extension stores automated steps for repetitive tasks?
Answers: 1
question
Computers and Technology, 23.06.2019 17:30
What are the most commonly found items in the trash according to the municipal solid waste report?
Answers: 1
question
Computers and Technology, 23.06.2019 21:30
Examine the list below. which factors positively affect lifetime income? check all that apply.
Answers: 1
You know the right answer?
Peyton is taking a part-time job to earn some extra money. Every week the manager will provide a lis...
Questions
Questions on the website: 13722360