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
Compare and contrast two fundamental security design principles in network security. Analyze how these principles and how they i
forsale [732]

Answer is given below :

Explanation:

Minimize attack surface area:

  • This area is often open to attackers due to the addition of features. For example, an unwanted text box in a web application can lead to SQL attacks. This can lead to data loss of information and privacy.

Least privilege:

  • Make sure the business process requires at least some money from users such as CPU usage, memory, file systems. The higher the resource consumption the higher the risk.

Fail secured:

  • However, there are many ways an app can fail with its process. The exception always comes with the handler‌ to handle failed cases.

Security been as simple as much:

  • Always create a simple way to maintain security. Come up with a simple code, it will go faster and faster.  Otherwise it will take unnecessary confusion and time.
5 0
2 years ago
PLEASE HELP ITS DRIVERS ED
sasho [114]
I will have to say the answer is.d
3 0
3 years ago
Read 2 more answers
If the algorithm does not have instructions for unanticipated results, the computer program will
bixtya [17]
ANSWER: The computer program will ✔ halt . A(n) ✔ recipe is an algorithm.

BRAINLIEST please and good luck!
7 0
3 years ago
Which of these technologies has been most used by terrorist organizations?
Paha777 [63]

Answer:

Phishing and Social Media

Explanation:

A quick web search can give you this information. Terrorist organizations have used social media to socially engineer innocent people into joining their organizations and more. Phishing is also an attack that's used to obtain critical information such as hashes or plaintext credentials to get into people's accounts. This is a tactic that's also been used by terrorist organizations in the past.

5 0
2 years ago
What is a life cycle
pochemuha

the definition of a life cycle is  the series of changes in the life of an organism, including reproduction

let me know if I helped <em>@OfficalOliviaB.</em>

4 0
3 years ago
Read 2 more answers
Other questions:
  • Multiple systems try to send data at the same time. The electrical impulses sent across the cable interfere with each other. Wha
    15·1 answer
  • What's the screen that displays results from typing text, performing calculations, or running programs?
    11·1 answer
  • ________ is installed into special, read-only memory of devices like printers and print servers or devices used for various type
    13·1 answer
  • c++ You are given an array A representing heights of students. All the students are asked to stand in rows. The students arrive
    5·1 answer
  • 2. What is an inanimate object? (1.0 points)
    14·1 answer
  • The process of adding a header to the data inherited from the layer above is called what option below
    8·1 answer
  • Using Phyton
    9·1 answer
  • Write a method doubleUp that doubles the size of a list of integers by doubling-up each element in the list. Assume there's enou
    13·1 answer
  • Employers are looking for an employee?<br>​
    9·1 answer
  • Is Invader Zim gonna come back?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!