摘要: def printInfo(): print("这个程序模拟两个选手A和B的羽毛球竞技比赛") print("程序需要两个选手的能力值0-1") print("规则:三局两胜--21分制") printInfo() 代码如下: 1 def printSummary(winsA,winsB): 2 3 阅读全文
posted @ 2020-05-13 16:17 Lo_11 阅读(331) 评论(0) 推荐(0)
摘要: import requests from bs4 import BeautifulSoup def getHTMLText(url): try: r=requests.get(url,timeout=30) soup=BeautifulSoup(r.text) r.raise_for_status( 阅读全文
posted @ 2020-05-13 16:09 Lo_11 阅读(221) 评论(0) 推荐(0)
摘要: import numpy as np import matplotlib.pyplot as plt import matplotlib matplotlib.rcParams['font.family']='YouYuan' matplotlib.rcParams['font.sans-serif 阅读全文
posted @ 2020-05-06 09:27 Lo_11 阅读(377) 评论(0) 推荐(0)
摘要: from PIL import Image import numpy as np vec_el=np.pi/3.2 vec_az=np.pi/3. depth=20. im=Image.open('111.jpg').convert('L') a=np.asarray(im).astype('flo 阅读全文
posted @ 2020-05-06 09:08 Lo_11 阅读(181) 评论(0) 推荐(0)
摘要: import numpy as np import matplotlib.pyplot as plt x=np.linspace(0,6,100) y=np.cos(2*np.pi*x)*np.exp(-x)+0.8 plt.plot(x,y,'k',color='r',linewidth=3,li 阅读全文
posted @ 2020-05-06 09:02 Lo_11 阅读(262) 评论(0) 推荐(0)
摘要: print('number of dim:',array.ndim) # 维度 # number of dim: 2 print('shape :',array.shape) # 行数和列数 # shape : (2, 3) print('size:',array.size) # 元素个数 # si 阅读全文
posted @ 2020-05-06 08:56 Lo_11 阅读(329) 评论(0) 推荐(0)
摘要: from random import random def printIntro(): print("这个程序模拟两支排球队A和B的排球比赛") print("程序运行需要A和B的能力值(以0到1之间的小数表示)") def getInputs(): a=eval(input("请输入队伍A的能力值 阅读全文
posted @ 2020-04-20 20:38 Lo_11 阅读(152) 评论(0) 推荐(0)
摘要: import random def printIntro(): print("这个程序模拟两支球队A和B的篮球比赛") print("程序运行需要球队A和B的能力值(以0到1之间的小数表示)") print("作者:Regan_White_Lin 12") def getInputs(): a = 阅读全文
posted @ 2020-04-20 20:36 Lo_11 阅读(159) 评论(0) 推荐(0)
摘要: from random import random def printIntro(): print("这个程序模拟两个选手A和B的乒乓球比赛") print("程序运行需要A和B的能力值(以0到1之间的小数表示)") def getInputs(): a = eval(input("请输入选手A的能 阅读全文
posted @ 2020-04-20 20:31 Lo_11 阅读(182) 评论(0) 推荐(0)
摘要: from PIL import Image ascii_char = list('中国真是个伟大的国家') def get_char(r, b, g, alpha=256): if alpha == 0: return ' ' gray = int(0.2126 * r + 0.7152 * g + 阅读全文
posted @ 2020-04-14 10:58 Lo_11 阅读(1577) 评论(0) 推荐(0)