python
Welosthesightof
这个作者很懒,什么都没留下…
展开
-
pygame案例代码
pygame原创 2022-07-11 01:11:56 · 1039 阅读 · 0 评论 -
猜数字游戏python
import tkinterimport tkinter.messageboximport randomnum_play = 0num_list = [1,2,3,4]def random_list(): global num_list a = [i for i in range(10)] x1 = random.choice(a) a.remove(x1) x2 = random.choice(a) a.remove(x2) x3 =原创 2021-10-19 19:13:45 · 1323 阅读 · 2 评论 -
python turtle 画图
樱花-python1.导入库2.基本框架3.定义花瓣和树主干的函数import turtleimport timeimport randomt = turtle.Turtle()w = turtle.Screen()t.up()t.left(90)t.backward(200)t.down()w.screensize(bg='wheat')t.color('sienna')def petal(times,t): for i in range(times):原创 2021-07-04 19:57:42 · 261 阅读 · 0 评论 -
python计算器
python 计算器创建主窗口创建文本输入框和按钮定义运算函数与显示函数import parserfrom tkinter import *from math import factorialroot = Tk()root.title("计算器")i=0def get_variables(num): global i display.insert(i,num) i+=1def clear_all(): display.delete(0,END)原创 2021-07-04 01:03:13 · 159 阅读 · 0 评论