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
What is an analog computer?<br>​
tigry1 [53]

Answer:

It is a computer that is used to process analog data.

7 0
2 years ago
Read 2 more answers
Can you please look through this code and see wants wrong with it? its in python
Ivanshal [37]
I’m confused what are you trying to ask? What is the python?
3 0
2 years ago
What is the primary purpose of endnotes?
mihalych1998 [28]

Answer:

They acknowledge the source of a quotation, paraphrase, or summary; and (2) They provide explanatory comments that would interrupt the flow of the main text.so its B

5 0
2 years ago
Read 2 more answers
WHO SAYS BUP ALL THE TIME ​
Delvig [45]

Answer:

Mario

Explanation:

7 0
3 years ago
A(n) _____ evaluates a specified data set and returns certain fields from that data set as instructed.
elena55 [62]

The correct answer is Query

5 0
3 years ago
Read 2 more answers
Other questions:
  • When would a one way flag variable be used
    10·1 answer
  • What's the screen that displays results from typing text, performing calculations, or running programs?
    11·1 answer
  • How do you ask brainy a question without it not liking the question and saying it hurts their feelings?
    14·1 answer
  • While working a night job at a call center, Eric creates an app called EatOut, which can be used to place orders at restaurants,
    14·1 answer
  • What does it mean when your check engine light comes on?
    7·1 answer
  • Help me match these answers
    5·1 answer
  • ​Client/server computing is​ a: A. network that connects sensors to desktop computers. B. distributed computing model where clie
    12·1 answer
  • What is the main difference between a search engine and a web browser?
    6·2 answers
  • in python Write a program that prompts the user to enter a hex character and displays its corresponding decimal integer python
    14·1 answer
  • Recommend how could you integrate positive aspects of digital literacy into your own
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!