Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def to_decimal(num, base):
- i = 1
- result = 0
- while num:
- digit = num % 10
- num = int(num / 10)
- result += digit * i
- i = i * base
- return result
- print(to_decimal(int(input()), int(input())))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement