Write a function print_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.".

1 answer

def print_shampoo_instructions(num_cycles):
if num_cycles < 1:
print("Too few.")
elif num_cycles > 4:
print("Too many.")
else:
for i in range(1, num_cycles+1):
print(str(i) + ": Lather and rinse.")
print("Done.")

print_shampoo_instructions(3)
Similar Questions
  1. How would I put this into one program?These are the directions: Write a method that takes two parameters. If the first parameter
    1. answers icon 0 answers
  2. I posted this question before:How would I put this into one program? These are the directions: Write a method that takes two
    1. answers icon 5 answers
    1. answers icon 1 answer
    1. answers icon 1 answer
more similar questions