Computers and Technology, 30.03.2021 23:50 achoward08
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
Answers: 2
Computers and Technology, 22.06.2019 16:20
Octothorpe is another name for what common computer keyboard symbol?
Answers: 1
Computers and Technology, 23.06.2019 20:30
What is the biggest difference between section breaks and regular page breaks
Answers: 1
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
Peyton is taking a part-time job to earn some extra money. Every week the manager will provide a lis...
English, 18.07.2019 08:00
Mathematics, 18.07.2019 08:00
Social Studies, 18.07.2019 08:00
Mathematics, 18.07.2019 08:00
Mathematics, 18.07.2019 08:00
Mathematics, 18.07.2019 08:00
Mathematics, 18.07.2019 08:00
Mathematics, 18.07.2019 08:00
Mathematics, 18.07.2019 08:00
Mathematics, 18.07.2019 08:00
Biology, 18.07.2019 08:00