Python Cookbook学习记录 ch6_1_2013/11/6
摘要:
6.1 温标的转换在开式温度,摄氏度,华氏温度及兰金温度之间做转换将功能封装在如下的类中:# -*- coding: cp936 -*-class Temperature(object): coefficients = {'c':(1.0,0.0,-273.15),'f':(1.8,-273.15,32),'r':(1.8,0.0,0.0)} def __init__ (self,**kwargs): try: name,value = kwargs.popitem() except KeyError: nam... 阅读全文
posted @ 2013-11-06 22:58 七海之风 阅读(249) 评论(0) 推荐(0)
浙公网安备 33010602011771号