摘要: def PI(n): pi=0 for k in range(n): pi += 1/pow(16,k)*(4/(8*k+1)-2/(8*k+4)-1/(8*k+5)-1/(8*k+6)) return pi import time scale = 20 print("执行开始".center(sc 阅读全文
posted @ 2020-12-15 18:19 yx-co 阅读(70) 评论(0) 推荐(0)
摘要: turtle.setup(width,height,startx,starty) 使用turtle的setup函数,可以在屏幕中生成一个窗口(窗体),设置窗体的大小和位置,这个窗口就是画布的范围。画布的最小单位是像素,屏幕的坐标系以左上角为原点(0,0)分布。 setup的四个参数分别指的是 wid 阅读全文
posted @ 2020-12-15 18:18 yx-co 阅读(294) 评论(0) 推荐(0)
摘要: 练习一:在终端输出如下信息‪‬‪‬‪‬‪‬‪‬‮‬‪‬‮‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‭‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‭‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‮‬ 小明,10岁,男,上山去砍柴 小明,10岁,男,开车去东北 小明,10岁,男,最 阅读全文
posted @ 2020-12-15 18:16 yx-co 阅读(87) 评论(0) 推荐(0)
摘要: Numpy: 基础的数学计算模块,以矩阵为主,纯数学。 SciPy: 基于Numpy,提供方法(函数库)直接计算结果,封装了一些高阶抽象和物理模型。比方说做个傅立叶变换,这是纯数学的,用Numpy;做个滤波器,这属于信号处理模型了,在Scipy里找。 Pandas: 提供了一套名为DataFrame 阅读全文
posted @ 2020-12-15 18:12 yx-co 阅读(118) 评论(0) 推荐(0)
摘要: (2)请用requests库的get()函数访问如下一个网站20次,打印返回状态,text()内容,计算text()属性和content属性所返回网页内容的长度。(不同学号选做如下网页,必做及格) 首先是谷歌主页的爬取 from pip._vendor import requests print(' 阅读全文
posted @ 2020-12-13 22:50 yx-co 阅读(57) 评论(0) 推荐(0)
摘要: # -*- encoding:utf-8 -*- ''' 模拟排球竞技 @author: bpf ''' # 比赛规则: # 1. 采用5局3胜制 # 2. 前四局采用25分制,每个队只有在赢得至少25分,且同时超过对方2分时才胜一局 # 3. 决胜局(第五局)采用15分制,先获得15分,且同时超过 阅读全文
posted @ 2020-11-22 21:01 yx-co 阅读(46) 评论(0) 推荐(0)
摘要: import jieba excludes = {"什么","一个","我们","那里","你们","如今","说道","知道","起来","姑娘","这里","出来","他们","众人","自己", "一面","只见","怎么",&quo 阅读全文
posted @ 2020-11-14 19:53 yx-co 阅读(32) 评论(0) 推荐(0)
摘要: import turtle as t import time def popspace(): #单管间隔 t.penup() t.fd(5) def popline(draw): #画数码管 popspace() t.pendown() if draw else t.penup() t.fd(40) 阅读全文
posted @ 2020-10-18 23:24 yx-co 阅读(64) 评论(0) 推荐(0)
摘要: import turtle for i in range(3): turtle.forward(100) turtle.right(120) turtle.left(60) turtle.forward(100) for i in range(3): turtle.right(120) turtle 阅读全文
posted @ 2020-09-15 21:55 yx-co 阅读(73) 评论(0) 推荐(0)
摘要: import turtle as t t.pensize(2) t.pencolor("black") t.right(30) t.forward(200) t.right(120) t.forward(300) t.right(120) t.forward(300) t.right(120) t. 阅读全文
posted @ 2020-09-15 21:52 yx-co 阅读(160) 评论(0) 推荐(0)