title: why is my parameters not defined in python?
body: <p>Before I debug my code, I would like to know why there's an error occurred when I call the function?
  It says "NameError: name 'stDigs' is not defined". I've tried using "avgUntilLetter(0123a)" and "avgUntilLetter("0123a")" but none of them works. Help me plz!</p>
  
  <p>This function receives as input one string containing digits or letters.
  The function should return one float number contaning the average calculated considering all the digits in the string starting form the first position and considerign all digits until one letter is found or until reaching the end of the string.</p>
  
  <p>An example:
  avgUntilLetter('0123a456') should return 1.5</p>
  
  <pre><code>def avgUntilLetter (stDigs):
      num = 0
      each_char = stDigs[num]
  
      while each_char.isdigit() == True and num &lt; len(stDigs):
          num = num + 1
          each_char = stDigs[num]
  
      digits = stDigs[0:num]
      avg = sum(digits)/len(digits)
  
      return avg
  
  avgUntilLetter(stDigs)
  </code></pre>
  
  <hr>
  
  <p>Yes, I know there are a lot errors needed to be solved. I just need to solve it one at a time. When I call the function using "avgUntilLetter ("0123a")", the defined error disappeared but a type error popped up. Hmm.. I'm still keeping trying it.</p>