摘要: from math import*from time import* scale=20s,m,=1,2print("执行开始".center(scale//2, "-"))start = perf_counter()for i in range(scale+1): s=sqrt((1-sqrt(1- 阅读全文
posted @ 2020-03-21 20:48 翁剑波 阅读(149) 评论(0) 推荐(0)
摘要: import timedef comput(): n =int(input('请输入要计算的长度:')) start_time = time.time() w = n+10 b = 10**w x1 = b*4//5 x2 = b// -239 he = x1+x2 n *= 2 for i in 阅读全文
posted @ 2020-03-21 20:45 翁剑波 阅读(601) 评论(0) 推荐(0)
摘要: Turtle库是Python语言中一个很流行的绘制图像的函数库,想象一个小乌龟,在一个横轴为x、纵轴为y的坐标系原点,(0,0)位置开始,它根据一组函数指令的控制,在这个平面坐标系中移动,从而在它爬行的路径上绘制了图形。 turtle绘图的基础知识:1. 画布(canvas) 画布就是turtle为 阅读全文
posted @ 2020-03-19 15:41 翁剑波 阅读(311) 评论(0) 推荐(0)
摘要: 一、画五角星 描述 画一个五角星,画笔用黄色,用红色填充,效果如下所示。 ‪‬‪‬‪‬‪‬‪‬‮‬‪‬‮‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‭‬‪‬‪‬‪‬‪‬‪‬‮‬‭‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‭‬‪‬ 代码如下: 1 2 3 4 5 阅读全文
posted @ 2020-03-19 15:35 翁剑波 阅读(1247) 评论(0) 推荐(0)
摘要: 使用turtle库绘制一个红色五角星图形 import turtle turtle.forward(100)turtle.right(144)turtle.forward(100)turtle.right(144)turtle.forward(100)turtle.right(144)turtle. 阅读全文
posted @ 2020-03-14 16:53 翁剑波 阅读(217) 评论(0) 推荐(0)