2.1 Convert Celsius to Fahrenheit.py

# -*- coding: utf-8 -*-
"""
Created on Sun Apr 22 14:57:48 2018

@author: MyPC
"""
def main():
    '''
    Convert Celsius to Fahrenheit.
    
    Official: fathrenheiit = (9/5) * celsius + 32
    input:celsius
    output:fathrenheiit
    '''
    
    celsius = eval(input("input Celsius:"))
    fahrenheit=(9 / 5) * celsius + 32
    print("%4.2f Celsius is %5.2f fahrenheit"%(celsius,fahrenheit))
    
    
if __name__ == "__main__":
    main()
    
    

    

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324684230&siteId=291194637