摘要: 实例01(创建计算BMI指数的模块) 1 def fun_bmi(person,height,weight): 2 '''功能:根据身高和体重计算BMI指数 3 person: 姓名 4 height: 身高,单位:米 5 weight: 体重,单位:千克 6 ''' 7 print(person 阅读全文
posted @ 2022-12-13 21:57 Sharonsss 阅读(35) 评论(0) 推荐(0)
摘要: 实战01(大乐透号码生成器) 1 from random import sample 2 def number(): 3 front = sample([str(i) for i in range(1,36)],5) 4 back = sample([str(i) for i in range(1, 阅读全文
posted @ 2022-12-13 21:21 Sharonsss 阅读(280) 评论(0) 推荐(0)
摘要: 实例01(使用wx.StaticText输出Python之禅) 1 # -*- coding:utf-8 -*- 2 import wx 3 class MyFrame(wx.Frame): 4 def __init__ (self, parent,id): 5 wx. Frame. __init_ 阅读全文
posted @ 2022-12-13 20:45 Sharonsss 阅读(51) 评论(0) 推荐(0)
摘要: 实例01(制作一个跳跃的小球游戏) 1 # -*- coding:utf-8 -*- 2 import sys 3 import pygame 4 pygame.init() 5 size=width,height=640,480 6 screen=pygame.display.set_mode(s 阅读全文
posted @ 2022-12-13 16:16 Sharonsss 阅读(33) 评论(0) 推荐(0)