Dec-16-2018, 11:55 PM
(This post was last modified: Dec-16-2018, 11:56 PM by ImLearningPython.)
The code works as it should with one exception, I can't seem to figure it out.
User-inputs a number and then I need the program to print
This is the code I have now for it.
User-inputs a number and then I need the program to print
1 : text
then 2 : text
until the number that was entered is reach. So input of 2 would result in 1 : text
then newline 2 : text
This is the code I have now for it.
def shampoo_instructions(num_cycles): if num_cycles < 1: print('Too few') elif num_cycles > 4: print('Too many') else: i = num_cycles while i <+ 4: print(i,': Lather and rinse.') i += 1 print('Done.') shampoo_instructions(2)OUTPUT
2 : Lather and rinse. 3 : Lather and rinse. Done.