title: How to convert letters to numbers in dict
body: <pre><code>def get_phone_number(word_str):
      numpad_dict={'a': 2, 'b': 2, 'c': 2, 'd': 3, 'e': 3, 'f': 3, 
                   'g': 4, 'h': 4, 'i': 4, 'j': 5, 'k': 5, 'l': 5, 
                   'm': 6, 'n': 6, 'o': 6, 'p': 7, 'q': 7, 'r': 7, 
                   's': 7, 't': 8, 'u': 8, 'v': 8, 'w': 9, 'x': 9, 'y': 9, 'z': 9}
      number = '0800painter'
      re_text = ''
      for digit in number:
          re_text += str(numpad_dict.get(digit, digit))
      return re_text
  
  
  def test_get_phone_number():
      print(get_phone_number('0800painter'))
      print(get_phone_number('0800fixnow'))
  
  def main():
      print("===========\nQuestion 1:")
      test_get_phone_number()
  main()
  </code></pre>
  
  <p>output:</p>
  
  <pre><code>===========
  Question 1:
  08007246837
  08007246837
  </code></pre>
  
  <p>I got one answer from my first def function, How to get second answer based on '0800fixnow'? Do I need to write two for loop to get the answer or just one?</p>