Santigratı Fahrenheit'e Çeviren Python Programı

İçindekiler

Bu programda, Celsuis'i Fahrenheit'e dönüştürmeyi ve görüntülemeyi öğreneceksiniz.

Bu örneği anlamak için, aşağıdaki Python programlama konuları hakkında bilgi sahibi olmalısınız:

  • Python Veri Türleri
  • Python Girişi, Çıktısı ve İçe Aktarma
  • Python Operatörleri

Aşağıdaki programda, Santigrat derece cinsinden bir sıcaklığı alıp Fahrenheit derecesine dönüştürüyoruz. Formül ile ilişkilidirler:

 santigrat * 1,8 = fahrenhayt - 32 

Kaynak kodu

 # Python Program to convert temperature in celsius to fahrenheit # change this value for a different result celsius = 37.5 # calculate fahrenheit fahrenheit = (celsius * 1.8) + 32 print('%0.1f degree Celsius is equal to %0.1f degree Fahrenheit' %(celsius,fahrenheit)) 

Çıktı

 37,5 derece Santigrat, 99,5 derece Fahrenheit'e eşittir 

Aşağıdaki formülü kullanarak Fahrenheit'i Santigrat'a dönüştürmek için bir Python programı oluşturmanızı öneririz.

 celsius = (fahrenheit - 32) / 1.8 

Ilginç makaleler...