title: Recursive function that prints digits of a number in english
body: <p>I am working on a program that uses a recursive function to print the digits of a number in English (i.e. 456 would display "Four Five Six".) I noticed someone else recently asked this question but I was unable to get any help from it. The program also requires that multiple numbers be entered from a user and each one should have the corresponding English digits displayed.  I tried doing this in a list but am unsure if that is correct.</p>
  
  <p>Right now I am beyond confused. I have been working on this for hours now and do not have much to show for it. I'm not looking for anyone to write this program for me, just offer some assistance. In theory I know what needs to be done but I'm having a very difficult time translating that into code.</p>
  
  <pre><code>def main():
      List = createList()
      print(createList())
  
  def listValue(prompt):
      try:
          number = eval(input(prompt))
          if type(number) == type(0) or type(number) == type(0.0):
              return number
          else:
              print("\nYou did not enter a number. Try again.")
      except NameError:
          print("\nYou did not enter a number. Try again.")
      except SyntaxError:
          print("\nYou did not enter a number. Try again.")
      except:
          print("\nAn exception occured. Try again.")
      if number != "":
          return number
     else:
          return None
  
  def createList():
      #Create a blank list
      newList = []
      item = listValue("Enter a list of numbers (&lt;Enter&gt; to quit): ")
      while item != None:
          #Add user input to the end of the created list
          newList.append(item)
          item = listValue("Enter a list of numbers (&lt;Enter&gt; to quit): ")
      return newList
  
  
  def displayEnglishDigits(number): 
      numEnglish = {0: "Zero", 1: "One", 2: "Two", 3: "Three", 4: "Four",
                    5: "Five", 6: "Six", 7: "Seven", 8: "Eight", 9: "Nine"}
      digit = Number % 10
  
  
  main()
  </code></pre>
  
  <p>here is the updated version of my code... any thoughts?</p>
  
  <pre><code>    def getNumbers():
          n = []
          xStr = input("Enter first digit of number (negative to quit) &gt;&gt; ")
          integer = int(xStr)
          while  integer &gt;= 0:
              while xStr != "":
                  x = eval(xStr)
                  n.append(x)
                  xStr = input("Enter next digit of number (negative to quit) &gt;&gt; ")
          return n
  
      def displayEnglishDigits(number):
          numEnglish = {0: "Zero", 1: "One", 2: "Two", 3: "Three", 4: "Four",
                        5: "Five", 6: "Six", 7: "Seven", 8: "Eight", 9: "Nine"}
          number = getNumbers()
          if len(number) == 0:
               return None
          if len(number) == 1:
              return number[0]
         else:
              value = displayEnglishDigits(number[1:])
         return value
  
      def display(values):
          print(displayEnglishDigits(number))
  
      def main():
          numb = getNumbers()
          nums = displayEnglishDigits(numb)
          display(nums)
  
      main()
  </code></pre>