forked from MukulCode/CodingClubIndia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Converter.py
58 lines (46 loc) · 1.19 KB
/
Converter.py
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
print ("1. Temp")
print ("2. speed")
print ("3. area")
aa= int(input("want to convert in "))
def temp(t):
switcher = {
1: (((b*9)/5)+32),
2: (((b-32)*5)/9),
}
return switcher.get(t, "nothing")
def Speed(s):
switcher ={
1: ((b*5)/18),
2: ((b*18)/5),
}
return switcher.get(s, "nothing")
def area(a):
switcher ={
1: (b*39.37),
2: (b*3.281),
3: (b*10.764),
4: (b*0.0001),
5: (b*0.000247),
}
return switcher.get(a, "nothing")
if (aa==1):
print ("1. degree C to degree F")
print ("2. degree F to degree C")
t=int(input("enter the converter number "))
b=int(input("enter the data "))
print(temp(t))
elif (aa==2):
print ("1. km/hr to m/s")
print ("2. m/s to km/hr")
s=int(input("enter the converter number "))
b=int(input("enter the data "))
print(Speed(s))
elif (aa==3):
print ("1. m to inch")
print ("2. m to feet")
print ("3. m.sq to sq.feet")
print ("4. m.sq to hectare")
print ("5. m.sq to acre")
a=int(input("enter the converter number "))
b=int(input("enter the data "))
print(area(a))