Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("------------------------------------")
- def _celcius_to_reamur(Celcius) :
- reamur = (4 * Celcius)/5
- return reamur
- def _celcius_to_farenheit(Celcius):
- farenheit = ((9 * Celcius)/5) + 32
- return farenheit
- def _celcius_to_kelvin(Celcius) :
- kelvin = (Celcius) + 273
- return kelvin
- def _reamur_to_celcius(Reamur):
- celcius = (Reamur * 5)/4
- return celcius
- def _reamur_to_farenheit(Reamur):
- farenheit = ((Reamur * 9)/4) + 32
- return farenheit
- def _reamur_to_kelvin(Reamur):
- kelvin = ((Reamur * 5)/4) + 273
- return kelvin
- def _farenheit_to_celcius(Farenheit):
- celcius = ((Farenheit - 32) * 5)/9
- return celcius
- def _farenheit_to_reamur(Farenheit):
- reamur = ((Farenheit -32)* 4)/9
- return reamur
- def _farenheit_to_kelvin(Farenheit):
- kelvin = (((Farenheit -32) * 5)/9) + 273
- return kelvin
- def _kelvin_to_celcius(Kelvin):
- celcius = (Kelvin - 273)
- return celcius
- def _kelvin_to_reamur(Kelvin):
- reamur = ((Kelvin -273)* 4)/5
- return reamur
- def _kelvin_to_farenheit(Kelvin):
- farenheit = (((Kelvin-273)*9)/5)+32
- return farenheit
- C = float(input("Masukkan suhu : "))
- print("Pilih mau diubah ke mana ?")
- print("[1] C -> R\t[4] R -> C\t[7] F -> C\t[10] K -> C")
- print("[2] C -> F\t[5] R -> F\t[8] F -> R\t[11] K -> R")
- print("[3] C -> K\t[6] R -> K\t[9] F -> K\t[12] K -> F")
- pilihan = input("Pilihan kamu :")
- if pilihan == "1" :
- hasil = _celcius_to_reamur(C)
- elif pilihan == "2" :
- hasil = _celcius_to_farenheit(C)
- elif pilihan == "3" :
- hasil = _celcius_to_kelvin(C)
- elif pilihan == "4" :
- hasil = _reamur_to_celcius(C)
- elif pilihan == "5" :
- hasil = _reamur_to_farenheit(C)
- elif pilihan == "6" :
- hasil = _reamur_to_kelvin(C)
- elif pilihan == "7" :
- hasil = _farenheit_to_celcius(C)
- elif pilihan == "8" :
- hasil = _farenheit_to_reamur(C)
- elif pilihan == "9" :
- hasil = _farenheit_to_kelvin(C)
- elif pilihan == "10" :
- hasil = _kelvin_to_celcius(C)
- elif pilihan == "11" :
- hasil = _kelvin_to_reamur(C)
- elif pilihan == "12" :
- hasil = _kelvin_to_farenheit(C)
- print("Jadi haislnya %.2f" % (hasil))
- print("------------------------------------")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement