《Python语言程序设计基础》第二版嵩天第二章程序练习题答案.pdfVIP

  • 19
  • 0
  • 约2.84千字
  • 约 2页
  • 2023-02-28 发布于山东
  • 举报

《Python语言程序设计基础》第二版嵩天第二章程序练习题答案.pdf

《Python语言程序设计基础》第二版嵩天第二章程序练习题答案--第1页 《Python语⾔程序设计基础》第⼆版嵩天第⼆章程序练习题答案 2.1 # TempConvert def TempConvert (value): if tempstr [-1] in [F ,f]: c = (eval(tempstr [0:-1]) - 32)/ 1.8 print (The temperature is converted to {}C .format (int(c))) elif tempstr [-1] in [C,c]: f = eval(tempstr [0:-1])*1.8 + 32 print(The temperature is converted to {}F .format (int(f))) else : print(Input wrong! ) tempstr = input(pls input the temperature with unit F or C: ) while tempstr [-1] not in [N,n]: TempConvert (tempstr

文档评论(0)

1亿VIP精品文档

相关文档