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]
4 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]4 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
What type of address uses a number that uniquely identifies each computer?
Anna [14]

Answer:

The awnser is D or IP Address

Explanation:

<h2>BRAINLIEST PLEASE</h2>
8 0
3 years ago
Read 2 more answers
The seven basic parts of a computer are
True [87]
Monitor, keyboard, CPU, mouse, and I believe the USB drive , DVD drive and hardware system
4 0
3 years ago
Read 2 more answers
after turning the volume all the way up on the speakers you still can't hear any sound which of the following should be your the
ivolga24 [154]

Answer:

check if its pluged in

Explanation:

7 0
4 years ago
Identifying the problem is crucial when trying to solve a problem. There are several techniques that you can use to aide you in
erica [24]
Consensus Building is NOT a technique that you can use to help you in identifying a problem.
8 0
3 years ago
If you have limited means, you...?
WITCHER [35]

Answer:

You have very little or limited amounts of an item(s).

Explanation:

6 0
3 years ago
Other questions:
  • The most significant factor in choosing a transmission method is its ____.
    10·1 answer
  • He ____________ may include a high-level WBS in a graphic chart format or as an indentured list of the work elements and associa
    14·1 answer
  • ​In addition to joint application development, another popular user-oriented method is _____, which resembles a condensed versio
    14·1 answer
  • Which is an example of a local government enforcing a national law?
    5·2 answers
  • Which would a student most likely do in a digital laboratory?
    13·2 answers
  • Assignment 1 is to write a program that will write the lyrics to "X number of beers on the wall". Use only the main method. Prom
    11·1 answer
  • Write a short assembly language program in either our 8088 SCO DOSBox or 80386+ MASM Visual Studio 2017 environment that demonst
    11·1 answer
  • What is the purpose of indexing?
    15·2 answers
  • Displays information a bout drivers, network connections, and other program-related details.
    6·1 answer
  • Computing is the provision of IT services on demand.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!