Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. pos = input()
  2. place = pos[-1]
  3. row1 = pos[:len(pos) - 1]
  4. res = 0
  5. row = int(row1)
  6. row-=1
  7. d = {"f":1, "e":2, "d":3, "a":4, "b":5, "c":6}
  8. res = (row // 4) * 12
  9. if row % 4 == 3:
  10. res+=4
  11. elif row % 4 == 1:
  12. res+= 6
  13. print(res + row + d[place])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement