Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- number = float(input())
- input_unit = input()
- output_unit = input()
- if input_unit == "mm" and output_unit == "cm":
- number = number * 0.1
- print(f"{number:.3f}")
- elif input_unit == "mm" and output_unit == "m":
- number = number * 0.001
- print(f"{number:.3f}")
- elif input_unit == "cm" and output_unit == "mm":
- number = number * 10
- print(f"{number:.3f}")
- elif input_unit == "cm" and output_unit == "m":
- number = number * 0.01
- print(f"{number:.3f}")
- elif input_unit == "m" and output_unit == "mm":
- number = number * 1000
- print(f"{number:.3f}")
- elif input_unit == "m" and output_unit == "cm":
- number = number * 100
- print(f"{number:.3f}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement