python简单的函数定义和使用范例,python函数范例,def convertT
python简单的函数定义和使用范例,python函数范例,def convertT
def convertTemp(temp, scale): if scale == "c": return (temp - 32.0) * (5.0/9.0) elif scale == "f": return temp * 9.0/5.0 + 32temp = int(input("Enter a temperature: "))scale = input("Enter the scale to convert to: ")converted = convertTemp(temp, scale)print("The converted temp is: " + str(converted))
相关内容
- 找出数组中出现频率超过一半的数,数组超过一半,有一
- 3行Python代码解简单的一元一次方程,3行python,solve("
- python直接通过邮件服务器端口发送邮件,python邮件服务
- Python从ftp服务器下载文件的代码,,#coding=utf-
- python操作sqlite的CRUD,pythonsqlitecrud,import sqlit
- Ubuntu,按下ctrl,查询选定的单词,ubuntuctrl,双击或拖选
- Python从URL地址提取文件名,,import osurl
- python从mymailbox.msg获取邮件信息,,import rfc82
- python中访问类的docstring注释的方法,pythondocstring,class
- python一句代码实现全排列,python一句代码,from itertoo
评论关闭