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
serious [3.7K]
2 years ago
9

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. Hint: Define and use a loop variable.
Computers and Technology
1 answer:
Masteriza [31]2 years ago
7 0

Answer:

See explaination

Explanation:

#Run the code in the python version 3.x.

#Define the function.

def shampoo_instructions(num_cycles):

#Check the cycles to be greater than 1.

if num_cycles < 1:

#Display the statement.

print('Too few.')

#Check the cycles to be greater than 4.

elif num_cycles > 4:

#Display the statement.

print('Too many.')

#The else part.

else:

#Initialize the variable.

N = 1;

#Begin the for loop.

for N in range(N, num_cycles+1):

#Print the result.

print(N , ": Lather and rinse.")

#Print the statement.

print('Done.')

#Call the function.

shampoo_instructions(2)

You might be interested in
The following loop is intended to print the numbers 1, 2, 3, 4, 5.
balu736 [363]

Answer:

range

Explanation:

range(num1, num2) returns the numbers from num1 up to but not including num2.

Example: range(1, 4) will return the numbers 1, 2, 3.

Hope this helps :)

8 0
2 years ago
To download a webpage, the web browser copies files and transfer them to your ____
Ganezh [65]

Computer is your best answer.


If you download the files, they will show up either on your computer home screen, or in the 'downloads' section of your computer files.



hope this helps

7 0
3 years ago
Read 2 more answers
What is the basic purpose of Google calendar?
goldenfox [79]
The basic purpose of a google calendar is basically the same as a regular calendar. it is used to keep track life's important events all in one place.    
7 0
2 years ago
Read 2 more answers
You are called to assist in troubleshooting a network problem that has occurred soon after a significant IPv6 implementation. So
HACTEHA [7]

Answer:i dont kowe

Explanation:

5 0
2 years ago
What is a computer meaning
goldenfox [79]

Answer:

computer means an electronic machine which process raw data and gives meaningful information to the user

7 0
2 years ago
Other questions:
  • What is the output of the following program?
    8·1 answer
  • Which of the following is a list of input devices?
    13·2 answers
  • 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
    6·1 answer
  • Grace whistles while tickling Camille with a feather. Eventually, Camille starts to squirm and giggle every time Grace whistles,
    10·1 answer
  • Sami is creating a web page for her dog walking business. Which item will set the theme for her page? Background color Heading c
    9·1 answer
  • George is sketching a wireframe representation of the home page of his website. What aspect of the home page would be impossible
    11·1 answer
  • We want to transmit 40 packets and the following packets are getting lost, 3,9, 25,28, 35. How many rounds are needed if
    5·1 answer
  • Qwertyuiopasdfghjklzxcvbnm??
    14·2 answers
  • 14 Convert the<br>following binary<br>numbers to decimal <br>0011​
    10·2 answers
  • D State Six Impact of ICT the society​
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!