-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathunit_converter.py
More file actions
103 lines (78 loc) · 2.85 KB
/
unit_converter.py
File metadata and controls
103 lines (78 loc) · 2.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
how_much = int(input("How much is the unit? "))
method = input("In what unit is it? (Meters, Kilometers, Centimeters, Millimeters, Yards) ")
into = input("In what unit should it be converted? (Meters, Kilometers, Centimeters, Millimeters, Yards) ")
if method == "Meters":
if into == "Meters":
print("Fuck You!")
if into == "Kilometers":
M_into_K = how_much/1000
print(f"It is {M_into_K} Kilometers")
if into == "Centimeters":
M_into_C = how_much*1000
print(f"It is {M_into_C} Centimeters")
if into == "Millimeters":
M_into_M = how_much*1000
print(f"It is {M_into_M} Millimeters")
if into == "Yards":
M_into_Y = how_much*1.09361
print(f"It is {M_into_Y} Yards")
if method == "Kilometers":
if into == "Kilometers":
print("Fuck You!")
if into == "Meters":
K_into_M = how_much*1000
print(f"It is {K_into_M} Meters")
if into == "Centimeters":
K_into_C = how_much*100000
print(f"It is {K_into_C} Centimeters")
if into == "Millimeters":
K_into_Mi = how_much*1000000
print(f"It is {K_into_Mi} Millimeters")
if into == "Yards":
K_into_Y = how_much*1093.61
print(f"It is {K_into_Y} Yards")
if method == "Centimeters":
if into == "Centimeters":
print("Fuck You!")
if into == "Kilometers":
C_into_K = how_much/100000
print(f"It is {C_into_K} Kilometers")
if into == "Meters":
C_into_M = how_much/1000
print(f"It is {C_into_M} Meters")
if into == "Millimeters":
C_into_Mi = how_much*10
print(f"It is {C_into_Mi} Millimeters")
if into == "Yards":
C_into_Y = how_much/91.44
print(f"It is {C_into_Y} Yards")
if method == "Yards":
if into == "Yards":
print("Fuck You!")
if into == "Kilometers":
Y_into_K = how_much/1093.61
print(f"It is {Y_into_K} Kilometers")
if into == "Meters":
Y_into_M = how_much*1.09361
print(f"It is {Y_into_M} Meters")
if into == "Millimeters":
Y_into_Mi = how_much/914.4
print(f"It is {Y_into_Mi} Millimeters")
if into == "Centimeters":
Y_into_C = how_much*91.44
print(f"It is {Y_into_C} Centimeters")
if method == "Millimeters":
if into == "Millimeters":
print("Fuck You!")
if into == "Kilometers":
Mi_into_K = how_much/1000000
print(f"It is {Mi_into_K} Kilometers")
if into == "Meters":
Mi_into_M = how_much/1000
print(f"It is {Mi_into_M} Meters")
if into == "Yards":
Mi_into_Y = how_much/914.4
print(f"It is {Mi_into_Y} Yards")
if into == "Centimeters":
Mi_into_C = how_much/10
print(f"It is {Mi_into_C} Centimeter")