SHARE
TWEET

Untitled

a guest Apr 23rd, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. metric_converter_dict = {'m': 1, 'mm': 100, 'cm': 100, 'mi': 0.000621371192, 'in': 39.3700787,
  2.                          'km': 0.001, 'ft': 3.2808399, 'yd': 1.0936133}
  3.  
  4. number = int(input())
  5. source_metric = input().lower()
  6. dest_metric = input().lower()
  7.  
  8. if source_metric in metric_converter_dict.keys() and dest_metric in metric_converter_dict.keys():
  9.     result = (metric_converter_dict[source_metric] / metric_converter_dict[dest_metric]) * number
  10.  
  11. print(f'{result} {dest_metric}')
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top