-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsatuan temperature.py
More file actions
60 lines (36 loc) · 1.27 KB
/
satuan temperature.py
File metadata and controls
60 lines (36 loc) · 1.27 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
# Latihan satuan Temperature
print ("=" * 45)
print ("\n\tPROGRAM KONVERSI TEMPERATURE\n")
print ("=" * 45)
# Celcius Ke Reamur
print (" ")
celcius = float(input("Masukkan Suhu Dalam Celcius : "))
print ("Suhu Adalah : ",celcius, "Celcius")
reamur = (4 / 5) * celcius
print ("Suhu Dalam Reamur Adalah : ",reamur)
# Celcius ke Fahrenheit
print (" ")
celcius = float(input("Masukkan Suhu Dalam Celcius : "))
print ("Suhu Adalah : ",celcius ,"Celcius")
fahrenheit = ((9 / 5) * celcius) + 32
print ("Suhu Dalam Fahrenheit Adalah : ",fahrenheit)
# Celcius Ke Kelvin
print (" ")
celcius = float(input("Masukkan Suhu Dalam Celcius : "))
print ("Suhu Adalah : ",celcius ,"Celcius")
kelvin = celcius + 273
print ("Suhu Dalam Kelvin Adalah : ",kelvin)
# Fahrenheit Ke kelvin
print (" ")
fahrenheit = float(input("Masukkan Suhu Dalam Fahrenheit : "))
print ("Suhu Adalah : ",fahrenheit,"Fahrenheit")
celcius = (5 / 9 * (fahrenheit - 32))
kelvin = celcius + 273
print ("Suhu Dalam Kelvin Adalah : ",kelvin, "Kelvin")
# Kelvin Ke Fahrenheit
print (" ")
kelvin = float(input("Masukkan Suhu Dalam Kelvin : "))
print ("Suhu Adalah : ",kelvin, "Kelvin")
celcius = kelvin - 273
fahrenheit = ((9 / 5) * celcius) - 32
print ("Suhu Dalam Fahrenheit Adalah : ",fahrenheit, "Fahrenheit")