2.1摄氏温度转为华氏温度.py

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

@author: MyPC
"""
def main():
    '''
    摄氏温度转为华氏温度.
    
    公式: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()
    
    

    

 

posted @ 2018-04-22 17:07  WY~记录  阅读(411)  评论(0编辑  收藏  举报