Search results
5 lis 2021 · Question: 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.".
def shampoo_instructions (user_cycles): if user_cycles < 1: print ("Too few.") elif user_cycles > 4: print ("Too many.") else: for i in range (1, user_cycles + 1): print (i,":","Lather and rinse.") print ("Done.") user_cycles = int (input ()) shampoo_instructions (user_cycles) The basics of Python (Intoduction to Scripting).
Function with loop: Shampoo. 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.". 1:Lather and rinse. 2 : Lather and rinse. Done.
5.7.2: Function with loop: Shampoo. 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.".
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.".
CHALLENGE ACTIVITY 5.7.2: Function with loop: Shampoo. 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.".
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window.