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
If you created a variable called name, what data type would that value be? Group of answer choices a float a string a Boolean an
Semenov [28]

I think its an integer

8 0
3 years ago
Read 2 more answers
The AND operator is a disjunction and the OR operator is a conjunction.
qwelly [4]

Answer:

True but it might be false but i think is true

8 0
2 years ago
In programming 2+6 is an example of what math
In-s [12.5K]

Answer:

beinggreat78~here~to~help.

2 + 6 in programming is an example of math. It is the same as in the real world. Plus signs in coding are also a form of <em>string concatenaction,</em> the term used for combining two strings into one, or a variable into a string.

5 0
2 years ago
Create and test an HTML document that describes nested ordered lists of cars. The outer list must have three entries: compact, m
melomori [17]

Answer:

Check the explanation

Explanation:

All website around the world/internet is a collection of different web pages, HTML can be referred to as the single most essential standard when it comes to web design, as well as it being the only one that’s enormously required or needed if you plan to create a web page.

to answer the question above, we will be creating an HTML document that describes nested ordered lists of cars, kindly check the attached images below to see the written codes to solve the question.

8 0
3 years ago
Please help me with this question ​
Anna35 [415]

Answer:

for this, u will have to put what u already know into a few stanzas and turn it in. hope this helps.

7 0
3 years ago
Other questions:
  • Alexei was given a key to a substitution cipher. The key showed that the entire alphabet was rotated 13 steps. What type of ciph
    7·1 answer
  • In a computerized accounting system, each transaction that is analyzed must be entered by hand into the appropriate journal and
    12·2 answers
  • The array index can be any nonnegative integer less than the array size.
    10·1 answer
  • How to write a self-analysis essay
    5·1 answer
  • Choose a film you have watched, or watch a film you have wanted to. Write a film review in at least three paragraphs. Describe w
    5·1 answer
  • Write a program that takes a date as input and outputs the date's season. The input is a string to represent the month and an in
    13·1 answer
  • im in honors comupter science and one of my questions is evaluate 18% 7 does anyone know how to answer that
    6·1 answer
  • In order to preview an attachment in an e-mail, click the attachment in the ______
    8·1 answer
  • ____________________________ and _________________________ are 2 positive impacts of the internet on businesses.
    14·2 answers
  • A profit of ₹ 1581 is to be divided amongst three partner P,Q and R in ratio 1/3:1/2:1/5.theshareof R will be?​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!