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.
1 answer:
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
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 :)
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
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.
Answer:i dont kowe
Explanation:
Answer:
computer means an electronic machine which process raw data and gives meaningful information to the user