Advertisement
VergeoPaw

Vergeo Valentino Gunawan 10K2

Sep 20th, 2021
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.10 KB | None | 0 0
  1. print("------------------------------------")
  2. def _celcius_to_reamur(Celcius) :
  3. reamur = (4 * Celcius)/5
  4. return reamur
  5.  
  6. def _celcius_to_farenheit(Celcius):
  7. farenheit = ((9 * Celcius)/5) + 32
  8. return farenheit
  9.  
  10. def _celcius_to_kelvin(Celcius) :
  11. kelvin = (Celcius) + 273
  12. return kelvin
  13.  
  14. def _reamur_to_celcius(Reamur):
  15. celcius = (Reamur * 5)/4
  16. return celcius
  17.  
  18. def _reamur_to_farenheit(Reamur):
  19. farenheit = ((Reamur * 9)/4) + 32
  20. return farenheit
  21.  
  22. def _reamur_to_kelvin(Reamur):
  23. kelvin = ((Reamur * 5)/4) + 273
  24. return kelvin
  25.  
  26. def _farenheit_to_celcius(Farenheit):
  27. celcius = ((Farenheit - 32) * 5)/9
  28. return celcius
  29.  
  30. def _farenheit_to_reamur(Farenheit):
  31. reamur = ((Farenheit -32)* 4)/9
  32. return reamur
  33.  
  34. def _farenheit_to_kelvin(Farenheit):
  35. kelvin = (((Farenheit -32) * 5)/9) + 273
  36. return kelvin
  37.  
  38. def _kelvin_to_celcius(Kelvin):
  39. celcius = (Kelvin - 273)
  40. return celcius
  41.  
  42. def _kelvin_to_reamur(Kelvin):
  43. reamur = ((Kelvin -273)* 4)/5
  44. return reamur
  45.  
  46. def _kelvin_to_farenheit(Kelvin):
  47. farenheit = (((Kelvin-273)*9)/5)+32
  48. return farenheit
  49.  
  50.  
  51.  
  52. C = float(input("Masukkan suhu : "))
  53. print("Pilih mau diubah ke mana ?")
  54. print("[1] C -> R\t[4] R -> C\t[7] F -> C\t[10] K -> C")
  55. print("[2] C -> F\t[5] R -> F\t[8] F -> R\t[11] K -> R")
  56. print("[3] C -> K\t[6] R -> K\t[9] F -> K\t[12] K -> F")
  57. pilihan = input("Pilihan kamu :")
  58.  
  59. if pilihan == "1" :
  60. hasil = _celcius_to_reamur(C)
  61. elif pilihan == "2" :
  62. hasil = _celcius_to_farenheit(C)
  63. elif pilihan == "3" :
  64. hasil = _celcius_to_kelvin(C)
  65. elif pilihan == "4" :
  66. hasil = _reamur_to_celcius(C)
  67. elif pilihan == "5" :
  68. hasil = _reamur_to_farenheit(C)
  69. elif pilihan == "6" :
  70. hasil = _reamur_to_kelvin(C)
  71. elif pilihan == "7" :
  72. hasil = _farenheit_to_celcius(C)
  73. elif pilihan == "8" :
  74. hasil = _farenheit_to_reamur(C)
  75. elif pilihan == "9" :
  76. hasil = _farenheit_to_kelvin(C)
  77. elif pilihan == "10" :
  78. hasil = _kelvin_to_celcius(C)
  79. elif pilihan == "11" :
  80. hasil = _kelvin_to_reamur(C)
  81. elif pilihan == "12" :
  82. hasil = _kelvin_to_farenheit(C)
  83.  
  84.  
  85. print("Jadi haislnya %.2f" % (hasil))
  86.  
  87. print("------------------------------------")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement