numpy数组和处理
摘要:#用列表+循环实现,并包装成函数 def pySum(n): a = list(range(10)) b = list(range(0, 50, 5)) c = [] for i in range(len(a)): c.append(a[i] ** 2 + b[i] ** 3) return(c) print(pySum(10)) #...
阅读全文
posted @
2018-09-29 21:25
095邓俊威
阅读(169)
推荐(0)
阶段作业1:完整的中英文词频统计
摘要:strBig ='''Big Big World Emilia I'm a big big girl In a big big world It's not a big big thing if you leave me But I do do feel that I too too will miss you much Miss you much. I can see t...
阅读全文
posted @
2018-09-27 11:34
095邓俊威
阅读(130)
推荐(0)
组合数据类型,英文词频统计
摘要: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邓俊威
阅读(142)
推荐(0)
产生一系列的网址
摘要: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邓俊威
阅读(111)
推荐(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邓俊威
阅读(499)
推荐(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邓俊威
阅读(277)
推荐(0)
作业3
摘要: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邓俊威
阅读(74)
推荐(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邓俊威
阅读(887)
推荐(0)