Advertisement
sconetto

Python - SENADO 2

Sep 4th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.89 KB | None | 0 0
  1. two = ["A", "B", "C"]
  2. three = ["D", "E", "F"]
  3. four = ["G", "H", "I"]
  4. five = ["J", "K", "L"]
  5. six = ["M", "N", "O"]
  6. seven = ["P", "Q", "R", "S"]
  7. eight = ["T", "U", "V"]
  8. nine = ["W", "X", "Y", "Z"]
  9. other = ["1", "0", "-"]
  10.  
  11. symbols =[two, three, four, five, six, seven, eight, nine]
  12.  
  13. number = input()
  14. counter = 0
  15.  
  16. for byte in number:
  17.     byte = number[counter].upper()
  18.     if byte in two:
  19.         print("2", end="")
  20.     elif byte in three:
  21.         print("3", end="")
  22.     elif byte in four:
  23.         print("4", end="")
  24.     elif byte in five:
  25.         print("5", end="")
  26.     elif byte in six:
  27.         print("6", end="")
  28.     elif byte in seven:
  29.         print("7", end="")
  30.     elif byte in eight:
  31.         print("8", end="")
  32.     elif byte in nine:
  33.             print("9", end="")
  34.     else:
  35.         print(byte,end="")
  36.     counter += 1
  37.     if counter > 29:
  38.         break
  39.  
  40. print("\n")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement