Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- N, B = input().split()
- s = 0
- for i in list(N):
- s *= int(B)
- if ord('0') <= ord(i) <= ord('9'):
- s = (s+int(i))
- else:
- s = (s+ord(i)-ord('A')+10)
- print(s)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement