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 16:20
Octothorpe is another name for what common computer keyboard symbol?
Answers: 1
question
Computers and Technology, 23.06.2019 20:30
What is the biggest difference between section breaks and regular page breaks
Answers: 1
question
Computers and Technology, 24.06.2019 07:30
Aproject involves many computing systems working together on disjointed task towards a single goal what form of computing would the project be using
Answers: 3
question
Computers and Technology, 25.06.2019 00:30
How do i take a screenshot on a laptop?
Answers: 2
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
question
Mathematics, 18.07.2019 08:00
question
Social Studies, 18.07.2019 08:00
question
Mathematics, 18.07.2019 08:00
question
Mathematics, 18.07.2019 08:00
Questions on the website: 13722363