⭐🚀 TkyNET | Blacklist ve Profesyonel DDoS Korumalı TeamSpeak 3 Sunucuları 🚀⭐
Sponsor Görsel
Server ip : 95.173.173.2 || Ts3 : LCAPRO www.lcapro.net
Sponsor Görsel 2
SponsorSponsor

Sıcaklık çevirici

Konu

#1
Merhaba,
Yapılan seçime göre (1/2) derece cinsinden girilen sıcaklık değerini celsius'tan fahrenheit'a ya da tam tersi yönde çeviren program.


Kod:
print("-" * 30)
print("1- Celsius to fahrenheit")
print("2- Fahrenheit to celsius")
print("-" * 30)

choice = raw_input("Your choice (1/2): ")

if choice == "1":
    print("\n# Celsius to Fahrenheit")
    celsius = float(raw_input("Degree to convert: "))
    fahrenheit = (celsius * 1.8) + 32
    print("{} degree celsius is equal to {} degree fahrenheit.".format(celsius, fahrenheit))
elif choice == "2":
    print("\n# Fahrenheit to Celsius")
    fahrenheit = float(raw_input("Degree to convert: "))
    celsius = (fahrenheit - 32) / 1.8
    print("{} degree fahrenheit is equal to {} degree celsius.".format(fahrenheit, celsius))
else:
    print("Congratulations! You hacked the super-program.")

Cevapla

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da