Advertisement
Guest User

Untitled

a guest
Aug 13th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. import math
  2. string = "AAAFU"
  3. number = 0
  4. a = -1
  5. letlist = ('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z')
  6. for i in letlist:
  7. a += 1
  8. if string[0] == i:
  9. number += math.pow(26,4) * a
  10. break
  11. a = -1
  12. for i in letlist:
  13. a += 1
  14. if string[1] == i:
  15. number += math.pow(26,3) * a
  16. break
  17. a = -1
  18. for i in letlist:
  19. a += 1
  20. if string[2] == i:
  21. number += math.pow(26,2) * a
  22. break
  23. a = -1
  24. for i in letlist:
  25. a += 1
  26. if string[3] == i:
  27. number += 26 * a
  28. break
  29. a = -1
  30. for i in letlist:
  31. a += 1
  32. if string[4] == i:
  33. number += a
  34. break
  35. print number
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement