title: Homework: Write a function shampoo_instructions() with parameter num_cycles
body: <p>The question: Write a function <code>shampoo_instructions()</code> with parameter <code>num_cycles</code>. If <code>num_cycles</code> is less than 1, print <code>"Too few."</code>. If more than 4, print <code>"Too many."</code>. Else, print <code>"N : Lather and rinse."</code> <code>num_cycles</code> times, where N is the cycle number, followed by <code>"Done."</code>. </p>
  
  <p>Sample output for the given program:
  1 : Lather and rinse.
  2 : Lather and rinse.
  Done.</p>
  
  <p>My code:</p>
  
  <pre><code>    def shampoo_instructions(num_cycles):
      if num_cycles &lt; 1:
          print ('Too few.')
      elif num_cyles &gt; 4:
          print ('Too many.')
      else:
          i = 0
          while i&lt;=num_cycles:
              i = i + 1
              print (i+1,": Lather and rinse")
  
      print ('Done')
  
  shampoo_instructions(2)
  </code></pre>
  
  <p>My code is throwing the following error and I can't seem to figure out how to define <code>num_cycles</code>.</p>
  
  <pre><code>Traceback (most recent call last):   File "main.py", line 14, in 
  shampoo_instructions(2)   File "main.py", line 4, in shampoo_instructions
  elif num_cyles &gt; 4: NameError: global name 'num_cyles' is not defined
  </code></pre>