2018年9月20日
摘要: classmates = ['Michael', 'Bob', 'Tracy','李三' ,'Tracy',56] new =['Rose','Jack'] classmates.insert(2,'Tom') classmates.append('Jack') classmates.extend(new) classmates.pop(1) print(classmates) s={1,2,... 阅读全文
posted @ 2018-09-20 11:43 095邓俊威 阅读(133) 评论(0) 推荐(0) 编辑
  2018年9月13日
摘要: for i in range(242): print('http://news.gzcc.cn/html/xiaoyuanxinwen/'+str(i)+'.html') C:\Users\Administrator\AppData\Local\Programs\Python\Python36\python.exe C:/Users/Administrator/PycharmPro... 阅读全文
posted @ 2018-09-13 10:30 095邓俊威 阅读(107) 评论(0) 推荐(0) 编辑
摘要: a = input('请输入身份证号码:') print('省份:',format(a[0:2]),'地区:',format(a[2:4]),'县级:',format(a[4:6]),'出生日期:',format(a[6:14])) if int(a[-2]) % 2==0: print('性别:女') else: print('性别:男') C:\Users... 阅读全文
posted @ 2018-09-13 09:50 095邓俊威 阅读(452) 评论(0) 推荐(0) 编辑
摘要: while True: a = input("摄氏转华氏请按1\n华氏转设施请按2\n") if a == '1': celsius = float(input('输入摄氏温度')) fahrenheit = (celsius * 1.8) + 32 print('{:.2f}摄氏温度转为华氏温度为{:.2f}'.format(c... 阅读全文
posted @ 2018-09-13 09:24 095邓俊威 阅读(256) 评论(0) 推荐(0) 编辑
  2018年9月6日
摘要: name1=int(input('请输入一个华氏温度:')) name2=int(input('请输入一个摄氏温度:')) a= round(5/9*(name1-32),3) b=round(name2*9/5+32,3) print('华氏温度{}转为摄氏温度:{}'.format(name1,a)) print('摄氏温度{}转为华氏温度:{}'.format(name2,b)) ... 阅读全文
posted @ 2018-09-06 11:41 095邓俊威 阅读(69) 评论(0) 推荐(0) 编辑
摘要: num1 = input('请输入一个数字:') num2 = input('请输入一个数字:') sum12 = float(num1) + float(num2) print('数字 {0} 和 {1} 的相加结果为:{2}'.format(num1,num2,sum12)) C:\Users\Administrator\AppData\Local\Programs\Pytho... 阅读全文
posted @ 2018-09-06 11:11 095邓俊威 阅读(805) 评论(0) 推荐(0) 编辑