I'm currently learning python in a Zybooks interactive eText and need someone to help me understand why this isn't working. Zybooks tests a few different iterations of your code and this one is working for three and failing on their fourth test. They don't actually tell you what they are testing until you run the code... Any help understanding where I'm going wrong is appreciated.
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 for the given program: 1 : Lather and rinse. 2 : Lather and rinse. Done.
Here is what I wrote that works for three of the five tests...
def shampoo_instructions(num_cycles):
if num_cycles < 1:
print('Too few.')
if num_cycles > 4:
print('Too many.')
else:
N = 0
while N < num_cycles:
print(N+1, ': Lather and rinse.')
N = N + 1
print('Done.')
shampoo_instructions(2) #this cannot be changed in the exercise
num_cycles=0. What do you see?0as the argument and observe the output, i.e.shampoo_instructions(0).