- 博客(9)
- 收藏
- 关注
原创 tkinter猜数字游戏
import tkinter import tkinter.messagebox import random shu = random.randint(1,100) root=tkinter.Tk() a=tkinter.Label(root,text="数字") a.place(x=0,y=0,height=30,width=30) a1=tkinter.Entry(root) a1.place(x=30,y=0,height=30,width=150) def call(): tkint
2020-12-14 19:57:29
217
原创 tkinter计算bmi
import tkinter import tkinter.messagebox root=tkinter.Tk() a=tkinter.Label(root,text="身高") a.place(x=0,y=0,height=30,width=30) b=tkinter.Label(root,text="体重") b.place(x=0,y=30,height=30,width=30) a1=tkinter.Entry(root) a1.place(x=30,y=0,height=30,width=1
2020-12-14 19:56:08
323
原创 python计算bmi
class bmi: def __init__(self,name,age,weight,height): self.name=name self.age=age self.weight=weight self.height=height def say_hello1(self): a=self.height**2 self_bmi=self.weight/a print
2020-12-09 20:46:37
514
原创 约瑟夫游戏代码
people={} for x in range(1,40): people[x]=1 check=0 i=1 j=0 while i<=40: if i == 40: i=1 elif j == 37: break else: if people[i] == 0: i+=1 continue else: check += 1
2020-11-10 18:15:53
345
原创 python猜数字游戏
import random a = random.randint(1,100) for i in range(5): num=int(input('请输入你猜的数字:')) if num > a: print('大了') elif num == a : print('中了') exit() elif num < a : print('小了') print('你没了') exit() ...
2020-11-08 18:48:10
146
原创 while中continue与break的区别
continue 结束当前循环进入下一个循环 i = 0 while i<5: i+=1 if i==3: continue print(i) 1 2 4 5 由上可见,使用continue时,当i=3时,continue之后的语句(即print(i))被直接跳过 break 结束循环,即直接跳出循环 i = 0 while i<5: i+=1 if i==3: break print(i) 1 2 由上
2020-11-08 18:31:24
151
原创 字典、元组、集合的增删改查
字典的增删改查 zidian={'1':'a','2':'b','3':'c'} 查找 print (zidian['1']) print (zidian) a {'1': 'a', '2': 'b', '3': 'c'} 增加 zidian['4']='d' print (zidian) {'1': 'a', '2': 'b', '3': 'c', '4': 'd'} 删除 zidian.pop('4') print (zidian) {'1': 'a', '2': 'b', '3': 'c'
2020-11-08 14:51:15
222
原创 Git的使用
Git的工作流程 Git的配置 1.配置github上的名字和邮箱: git config --global user.name “Your Name” git config --global user.email “email@example.com” 可以使用git config --global --list查看是否配置成功 2.生成连接到github的密钥: 输入 ssh-keygen -t rsa -C “oldinaction@qq.com” 然后按三下回车键,成功后会在 C:\Use
2020-10-25 15:51:13
165
原创 Markdown的使用
标题 一级标题 二级标题 三级标题 文字前面加上#以及空格则为标题,多个#作为多级标题 分割线 下面这个是分割线,另起一行并加上三个*即可 粗体和斜体 这个是粗体,这个是斜体 表格 周一 周二 周三 游戏 睡觉 吃饭 学习 学习 学习 插入链接和图片 百度 百度 百度 百度 百度 (下面这个为本地图片上传) 代码框 代码框代码框代码框代码框代码框代码框代码框代码框代码框代码框代码框代码框代码框代码框代码框代码框代码框代码框代码框代码框代码框代码框代码框代码框 引用 下面
2020-10-24 12:55:01
160
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅