hdarwin

cstutoringcenter.com_US Telephone Keypads

Dec 30th, 2012
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. sum = 1
  2. keypad = {"A":2, "B":2, "C":2,
  3.           "D":3, "E":3, "F":3,
  4.           "G":4, "H":4, "I":4,
  5.           "J":5, "K":5, "L":5,
  6.           "M":6, "N":6, "O":6,
  7.           "P":7, "R":7, "S":7,
  8.           "T":8, "U":8, "V":8,
  9.           "W":9, "X":9, "Y":9,
  10.           " ":1}
  11. for x in "Programming Challenges are fun":
  12.     sum *= keypad[x.upper()]
  13. print sum
Advertisement
Add Comment
Please, Sign In to add comment