Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- string = "AAAFU"
- number = 0
- a = -1
- 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')
- for i in letlist:
- a += 1
- if string[0] == i:
- number += math.pow(26,4) * a
- break
- a = -1
- for i in letlist:
- a += 1
- if string[1] == i:
- number += math.pow(26,3) * a
- break
- a = -1
- for i in letlist:
- a += 1
- if string[2] == i:
- number += math.pow(26,2) * a
- break
- a = -1
- for i in letlist:
- a += 1
- if string[3] == i:
- number += 26 * a
- break
- a = -1
- for i in letlist:
- a += 1
- if string[4] == i:
- number += a
- break
- print number
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement