Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def gorner(num,base):
- r=0
- for s in num.lower():
- r=r*base+ord(s)-ord('0') if s.isdigit() else r*base+ord(s)-ord('a')+10
- return r
- print gorner('A',16)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement