Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x = int(input())
- a = input()
- b = input()
- d = {'mm': 1, 'cm': 2, 'dm': 3, 'm': 4, 'km': 7}
- def convert(x, a, b):
- if (d[b] - d[a]) > 0:
- temp = 10 ** abs((d[b] - d[a]))
- return x / temp
- elif (d[b] - d[a]) < 0:
- temp = 10 ** abs((d[b] - d[a]))
- return x * temp
- print(convert(x, a, b))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement