Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit = float(input())
- conv_from = str(input())
- conv_to = str(input())
- converted = 0
- if conv_from == "mm" and conv_to == "cm":
- converted = unit / 10
- elif conv_from == "mm" and conv_to == "m":
- converted = unit / 1000
- elif conv_from == "cm" and conv_to == "mm":
- converted = unit * 10
- elif conv_from == "cm" and conv_to == "m":
- converted = unit / 100
- elif conv_from == "m" and conv_to == "cm":
- converted = unit * 100
- elif conv_from == "m" and conv_to == "mm":
- converted = unit * 1000
- print(f"{converted:.3f}")
Add Comment
Please, Sign In to add comment