TEMPERATURE CALCULATOR Program in Python

 

 TEMPERATURE CALCULATOR Program in Python



Program:

# Temprature convertor by DATA DEMONS.

def TempForC(Temprature):
    print()

    print(str(Temprature) + 'C')

    print(str((Temprature * (9 / 5)) + 32) + "F")

    print(str(Temprature + 273.15) + "K")
    print()


def TempForF(Temprature):
    print()

    print(str(Temprature) + 'F')
    
    print(str((Temprature - 32) * (9 / 5)) + "C")

    print(str(((Temprature - 32) * (9 / 5)) + 273.15) + "K")
    print()


def TempForK(Temprature):
    print()

    print(str(Temprature) + 'K')

    print(str(Temprature - 273.15) + "C")

    print(str(((Temprature - 273.15) * (9 / 5)) + 32) + "F")
    print()

# Inputs for calculating
TempFrom = input("From C/F/K :")
Temprature = float(input("Enter your temprature :"))

# Making directions for calculating.
if TempFrom.upper() == "C": TempForC(Temprature)
elif TempFrom.upper() == "F": TempForF(Temprature)
elif TempFrom.upper() == "K": TempForK(Temprature)
else: print("Give a valid unit.")


Programmer details : Arun Meyyappan PL
Software used: Visual studio CODE
Version : 1.74.3

Documents and files download link

Python File(.py)


Text File(.txt)

0 Comments