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
Nesterboy [21]
3 years ago
7

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.

Computers and Technology
1 answer:
Rashid [163]3 years ago
3 0

Answer:

The code written in python and fully commented for this question is given below:

# Create the function shampoo_instructions with the num_cycles parameter input

def shampoo_instructions(num_cycles):

   # Condition if is less than 1, print too few

   if num_cycles < 1:

       print("Too few.")

   # Condition if is greater than 4, print too many

   elif num_cycles > 4:

       print("Too many.")

   # If is in inclusive range [1,4], print the Lather and rinse cycle

   else:

       # Create a for loop to print rinse cycle

       for i in range(num_cycles):

           print("{}: Lather and rinse.".format(i+1))

   # Print an end string for each execution

   print("End-------------------------------------")

# Call the function with all the conditions tested

shampoo_instructions(3)

shampoo_instructions(0)

shampoo_instructions(4)

shampoo_instructions(5)

Explanation:

I attach an image that contains the output of the execution and the source code.

You might be interested in
Aubrey is on a Windows machine. She wants to back up her Halloween pictures on an external hard drive. Which of the following ta
Leya [2.2K]

Answer:

no clu3 lol

Explanation:

I'm stupid hahaha

8 0
3 years ago
Referat noaptea la școala cu sfârșit de groază​
solniwko [45]

Te ajut eu daca vrei tu la refera

7 0
3 years ago
Double[][] vals =
Vilka [71]

Answer:

4

Explanation:

by counting the number of the colum to. be counted well and nicely

8 0
3 years ago
A system administrator needs to create a high-performance SQL server. What type of disk configuration will allow the administrat
Studentka2010 [4]

Answer:

Pass-through disk

Explanation:

Pass-through disk configuration will allow the administrator to connect an offline physical disk that is connected to the host machine to a VM to maximize a VM's performance.

VMs access a physical hard disk by way of a "pass-through disk," a special virtual disk that directly accesses the physical disk if it is made exclusively available to the VM.

A pass-through disk must be offline in the parent partition of the Hyper-V server.

4 0
3 years ago
What type of machine is the energy of a seismic wave recorded?
Sloan [31]
<span>the answer is most likely "Seismograph"</span>
7 0
3 years ago
Other questions:
  • Why do many administrators choose to use a command line interface on a Linux server?
    12·1 answer
  • Produce definition in computer
    12·2 answers
  • COMPUTER SCIENCE:PIXELS
    5·1 answer
  • IDE devices require the use of a controller mounted on the motherboard. True False
    14·2 answers
  • Lisa has a section of her document that she would like to include in the index. Which option should Lisa choose?
    5·2 answers
  • What does mean I can’t turn on my computer and my computer won’t charge at all
    15·1 answer
  • In Google search results, how are organic links different from sponsored links?
    5·2 answers
  • What is the HCF of smallest prime number and the smallest composite number?​
    12·1 answer
  • What code would you use to create the login button?
    11·1 answer
  • Please help me asapppp!​
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!