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
As you're helping a user configure her e-mail over the phone, she remarks that the IP address is different than it was when she
WINSTONCH [101]

Answer:

D. Her computer is a DHCP client.

Explanation:

Since in the question it is mentioned that IP address is different as compared in the previous week also the user did not make any changes with respect to the TCP/IP configuration and the system is working well

So this situation represents that the user computer is a client of DHCP as it deals with the client-server protocol in which it automatically generates the IP i.e Internet protocol along with the IP address

Hence, the correct option is d.

4 0
4 years ago
Which sounds better, a cassette or vinyl???
katen-ka-za [31]
A vinyl . I hope I helped !
5 0
3 years ago
Use-case points is a project effort estimation approach based on unique features of _______ and object orientation.
Lelechka [254]
The choices that should have been included are: 

a. functions
b. classes
c. objects
d. projects
e. use cases

Use-case points is a project effort estimation approach based on unique features of E. USE CASES and object orientation.
7 0
3 years ago
Suppose a raptor center has 9 owls and 12 hawks. What percent of these birds are hawks? Round your answer to the nearest whole p
Andrews [41]
Givghjn gujbfuj. Gunghiyvb cvcybv
5 0
4 years ago
¿porque y como surge la informatica y las computadoras
LekaFEV [45]

Answer: La informática es el futuro: un puente hacia todas las cosas útiles.

La informática aprovecha el poder y la posibilidad de la tecnología digital para transformar datos e información en conocimiento que la gente usa todos los días. Este fuerte enfoque en el uso humano de la informática ayuda a las personas a interactuar con la tecnología de la mejor y más eficiente manera posible.

Explanation:

8 0
3 years ago
Other questions:
  • What will be displayed if code corresponding to the following pseudocode is executed? Set Number = 4 Repeat Write 2 * Number Set
    12·1 answer
  • A School is interested in computerizing their students&lt;br /&gt;grading system.&lt;br /&gt;I Marks Grade&lt;br /&gt;150-100 A&
    11·1 answer
  • I want to be a teacher some day and i know this question------------- Humans have a nose to breath , but what do fishes use to h
    6·2 answers
  • Your environment includes many users who print documents often. A single print device isn't sufficient. You need a "printer pool
    7·1 answer
  • You have been asked to create a Community leveraging Out-of-the-box login, logout, self-registration, and error pages. Would you
    5·1 answer
  • Can you give me a long list of anime
    6·2 answers
  • Define Technology In Your Own Words.
    8·1 answer
  • Given the code below, which three statements can be used to create the controller variable?
    5·1 answer
  • A deluxe meal, represented by a DeluxeMeal object, includes a side dish and a drink for an additional cost of $3. The DeluxeMeal
    14·1 answer
  • create a function that draws a certain number of spaces, followed by a certain number of stars, followed by a newline.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!