摘要: #温度转换 while True: a=int(input ("华氏转摄氏请按1\n摄氏转华氏请按2\n")) if a==1: h1=float(input ("请输入一个华氏温度:")) s1= 5/9 *(h1-32) print ("摄氏温度为\n",format(s1)) elif a==2: h2 = ... 阅读全文
posted @ 2018-09-13 21:36 Peace* 阅读(127) 评论(0) 推荐(0) 编辑
摘要: myid='4401178199705094322' age=2018-int(myid[6:10]) if int(myid[-2])%2==0: sex='girl' else: sex='boy' print(age,sex) #用字符串表示自己的学号,分隔出年级、专业、班级、序号 s ='201606050054' a=s[:4] b=s[4:6] c=s[6... 阅读全文
posted @ 2018-09-13 11:43 Peace* 阅读(69) 评论(0) 推荐(0) 编辑