python - Shampoo cycle loop -
I have trouble finding out how to stop the loop in my code:
def shampoo_instructions (num_cycles): For num_cycles in the category (1, num_cycles + 1): If num_cycles & lt; 1: Print 'very low.' Eleph num_cycles & gt; 4: Print 'lots'. Else: Print num_cycles, ': stir and rinse.' Other: Print 'done'. Shampoo_instructions (2) My output will be:
1: stir and rinse.
2: stir and rinse.
Done.
How can I create this when shampoo_design (6)
it just prints "lots."
?
To move your class check out of your actual loop, example: < Previous> def shampoo_directories (num_cycles): if num_cycles & lt; 1: Print 'very low.' Alif New_ Psyllae & gt; 4: Print 'lots'. Other: For num_cycles in the category (1, num_cycles + 1): printed num_cycles, 'lather and rinse.' Print 'Done'
Comments
Post a Comment