1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
UNO [17]
3 years ago
11

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
Computers and Technology
1 answer:
nata0808 [166]3 years ago
7 0

Answer:

The function is as follows:

def tasks(Petyontasks):

   timespent = 0

   for i, tsk in enumerate(Petyontasks):

       if timespent<=10:

           timespent+=tsk

       else:

           break

   print("Finish "+str(i)+" tasks in "+str(timespent)+" hours")

Explanation:

The program in the question cannot be traced. Hence, the need to begin from scratch.

This defines the function

def tasks(Petyontasks):

This initializes timespent to 0

   timespent = 0

This iterates through the tasks [i represents the count of the tasks while tsk represents the time on each task]

   for i, tsk in enumerate(Petyontasks):

If timespent is less or equal to 10

       if timespent<=10:

The tasks is added and the timespent is calculated

           timespent+=tsk

If otherwise

       else:

The loop is exited

           break

This prints the required output

   print("Finish "+str(i)+" tasks in "+str(timespent)+" hours")

You might be interested in
In Word, tables can be styled much like text can.<br> True<br> False
Delvig [45]

Answer:

True

Explanation:

There are many formatting options from color, size, and many more.

Hope this helps!

3 0
3 years ago
ITEMS
Rzqust [24]

Answer:

Total money he had = $136 (Approx.)

Explanation:

Given:

Spend on rent = 25%

Spend on food = 30%

Total of expenses = $75

Find:

Total money he had

Computation:

Total money he had = [Total of expenses][100/ (Spend on rent + Spend on food)]

Total money he had = [75][100/ (25 + 30)]

Total money he had = [75][100/ (55)]

Total money he had = 136.36

Total money he had = $136 (Approx.)

8 0
3 years ago
Which of these devices must be installed in every indevidual computing device on the network
Likurg_2 [28]

Answer:

i nneed more info

Explanation:

6 0
3 years ago
1.1<br> What are three reasons why decision-making is required in a programmed work cyde?
fgiga [73]

Answer:

Programmed decisions are those that are repeated over time and for which an existing set of rules can be developed to guide the process. These decisions might simple, or they could be fairly complex, but the criteria that go into making the decision are all known or can at least be estimated with a reasonable degree of accuracy. For example, deciding how many raw materials to order should be a programmed decision based on anticipated production, existing stock, and anticipated length of time for the delivery of the final product. As another example, consider a retail store manager developing the weekly work schedule for part-time employees. The manager must consider how busy the store is likely to be, taking into account seasonal fluctuations in business. Then, she must consider the availability of the workers by taking into account requests for vacation and for other obligations that employees might have (such as school). Establishing the schedule might be complex, but it is still a programmed decision: it is made on a regular basis based on well-understood criteria, so structure can be applied to the process. For programmed decisions, managers often develop heuristics, or mental shortcuts, to help reach a decision. For example, the retail store manager may not know how busy the store will be the week of a big sale, but might routinely increase staff by 30% every time there is a big sale (because this has been fairly effective in the past). Heuristics are efficient—they save time for the decision maker by generating an adequate solution quickly. Heuristics don’t necessarily yield the optimal solution—deeper cognitive processing may be required for that. However, they generally yield a good solution. Heuristics are often used for programmed decisions, because experience in making the decision over and over helps the decision maker know what to expect and how to react. Programmed decision-making can also be taught fairly easily to another person. The rules and criteria, and how they relate to outcomes, can be clearly laid out so that a good decision can be reached by the new decision maker. Programmed decisions are also sometimes referred to as routine or low-involvement decisions because they don’t require in-depth mental processing to reach a decision. High- and low-involvement decisions are illustrated in.

5 0
3 years ago
PowerPoint’s _____ feature can assist you in finding answers to questions such as “How can I specify which slides to print?” a.
jeka94
I'm pretty sure it is C, Slide Sorter
7 0
4 years ago
Other questions:
  • When composing a tweet with images attached in hootsuite, bear in mind that _____ characters are used up by the photos?
    9·1 answer
  • Whoevr answers this will be marked brainliest
    12·1 answer
  • Using the drop-down menus, correctly complete the sentences.
    5·2 answers
  • A ________ separates traditional voice telephone transmission from the data transmissions in the equipment located at the custom
    11·1 answer
  • Keep the base of your _________ on the mouse pad or desk?
    12·2 answers
  • LAB:
    8·1 answer
  • In the retrieval phase of Godden and Baddeley (1975) study of the encoding specificity principle, participants were asked to sup
    9·1 answer
  • In the space provided, analyze the pros and cons of becoming a member of an artistic guild. Your answer should be at least 150 w
    12·1 answer
  • Please help I don’t know
    5·1 answer
  • Places where computer are used​
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!