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
serious [3.7K]
3 years ago
9

Write a function shampoo_instructions() with parameter num_cycles. If num_cycles is less than 1, print "Too few.". If more than

4, print "Too many.". Else, print "N : Lather and rinse." num_cycles times, where N is the cycle number, followed by "Done.". Sample output with input: 2 1 : Lather and rinse. 2 : Lather and rinse. Done. Hint: Define and use a loop variable.
Computers and Technology
1 answer:
Masteriza [31]3 years ago
7 0

Answer:

See explaination

Explanation:

#Run the code in the python version 3.x.

#Define the function.

def shampoo_instructions(num_cycles):

#Check the cycles to be greater than 1.

if num_cycles < 1:

#Display the statement.

print('Too few.')

#Check the cycles to be greater than 4.

elif num_cycles > 4:

#Display the statement.

print('Too many.')

#The else part.

else:

#Initialize the variable.

N = 1;

#Begin the for loop.

for N in range(N, num_cycles+1):

#Print the result.

print(N , ": Lather and rinse.")

#Print the statement.

print('Done.')

#Call the function.

shampoo_instructions(2)

You might be interested in
In this screenshot, the circled item is the
gavmur [86]

Answer:

Favorites tab/bar

Explanation:

6 0
3 years ago
Read 2 more answers
What is modem please give me answer​
rjkz [21]

Answer:

a combined device for modulations and demodulations

4 0
4 years ago
Part 3:<br> Please answer
Levart [38]

Answer:

a) 4 processes

b) 2 resources

c) R1: 2 instances

   R2: 2 instances

d) R2

e) R1

f) R1

g) No resource

h)  R1

i) R2

j) R2

k) No

l)No deadlock

Explanation:

You need to know that the resources that are required by the processes for completion are shown by the request edge and the resources allocated are shown by the allocation edge. And thus, we can find what resources are allocated to the process, and required for the completion accordingly. And here again, the cycle is created, and hence deadlock may or may not occur. However, we see that resources have multiple instances and get freed on time. And hence, deadlock does not occur.

Like,

P4 uses R2 and free one instance of R2.

P3 then uses one instance of R2 and free R2.

P3 then uses one instance of R3 and free R3.

P1 uses one instance of R1 and free R1 one instance

P1 then uses R2 and free R2.

P2 uses R1 and free R1.

Hence, all the processes are complete and deadlock does not occur.

3 0
3 years ago
During the conflict resolution process, which of the followings statements would be appropriate when defining the problem?
Mrac [35]
Maybe d




Idk for sure









6 0
3 years ago
Read 2 more answers
Many everyday objects (such as amusement park rides, cars, elevators, and ovens) that you might not normally associate with a co
lisabon 2012 [21]

Answer:

Major risks include computer security and maintability of the software and hardware components of the computers in these objects.

I may feel more scared if I was riding a roller coaster that was computer controlled because if there were vunerabilities in the computer's software, a hacker could exploit that and remotely have access to the controls of the roller coaster, putting many people's lives at risk.

I think the benefits of computerizing an increasing number of everyday objects outweigh the potential risks.

This is because computers is very reliable and they do exactly what you tell them to do. However, humans are clumsy and can sometimes be extremely stubborn. Computerizing more everyday objects is an overall good thing for society, however, policies and protocols need to be followed to ensure these computerized objects remain secure.

Explanation:

Hope this helps.

4 0
3 years ago
Other questions:
  • Emma wants to create a web page for her school’s volleyball team. Which of these could she use?
    7·1 answer
  • Which icon will automatically adjust the amount of space between letters from very tight to very loose in style? Hyphenation, Te
    6·2 answers
  • Write a loop that continually asks the user what pets the user has, until the user enters "rock", in which case the loop ends. I
    12·1 answer
  • A virus or worm can have a payload that installs a(n) __________ door or trap-door component in a system, which allows the attac
    14·2 answers
  • Create a loop that will output all the multiples of 5 that are greater than zero and less than 60 (do not include 60). 5, 10, 15
    10·1 answer
  • Write a program with a loop that lets the user enter a series of positive integers. The user should enter −1 to signal the end o
    7·1 answer
  • Fatal error: Class 'Drush\Commands\DrushCommands' not found in /Users/amy/testsite/Sites/acquia dev desktop/fresh-install/module
    7·1 answer
  • The term packet is used fairly generically to refer to protocol data unit (PDU). There are PDU equivalent names in the different
    15·1 answer
  • நெறி என்னும் சொல்லின் பொருள்___ *​
    14·1 answer
  • The most important part of a computer​
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!