Bu programda Santigrat dereceyi Fahrenheit dereceye dönüştürmeyi ve görüntülemeyi öğreneceksiniz.
Aşağıdaki programda, Santigrat derece cinsinden bir sıcaklığı alıp Fahrenheit derecesine dönüştürüyoruz. Formül ile ilişkilidirler:
1 2 3 | celsius * 1.8 = fahrenheit - 32 |
Python kodu:
1 2 3 4 5 6 7 8 9 10 | # Santigrat cinsinden sıcaklığı fahrenhayta dönüştürmek için Python Programı # bu değeri farklı bir sonuç için değiştirin celsius = 37.5 # fahrenhayt hesapla fahrenheit = (celsius * 1.8) + 32 print('%0.1f Celsius derece ,%0.1f Fahrenheit derecesine eşittir' %(celsius,fahrenheit)) |
Python kodu: Kullanıcıdan santigrat alarak yapma
1 2 3 4 5 6 7 8 9 10 | # Santigrat cinsinden sıcaklığı fahrenhayta dönüştürmek için Python Programı # bu değeri farklı bir sonuç için değiştirin celsius = float(input('Ceslius derece girin:')) # fahrenhayt hesapla fahrenheit = (celsius * 1.8) + 32 print('%0.1f Celsius derece ,%0.1f Fahrenheit derecesine eşittir' %(celsius,fahrenheit)) |
Çıktı:
1 2 3 4 | Ceslius derece girin:12 12.0 Celsius derece ,53.6 Fahrenheit derecesine eşittir |
İlginizi çekebilir: Python Örnekleri
Örnek: 200 derece kaç fahrenayt yapar
1 2 3 4 5 6 7 8 9 10 | # Santigrat cinsinden sıcaklığı fahrenhayta dönüştürmek için Python Programı # bu değeri farklı bir sonuç için değiştirin celsius = 200 # fahrenhayt hesapla fahrenheit = (celsius * 1.8) + 32 print('%0.1f Celsius derece ,%0.1f Fahrenheit derecesine eşittir' %(celsius,fahrenheit)) |
Çıktı:
1 2 3 4 | Ceslius derece girin:200 200.0 Celsius derece, 392.0 Fahrenheit derecesine eşittir |
Bu yazımızda Pyhon Giriş Komutlarını kullanarak Santigratı Fahrenheit’a Çeviren Python Programını yaptık. Daha fazla python konusu için Python Dersleri konusunu inceleyiniz.
Yorum Yap