摘要: Division_apple def division(): print('\n 分苹果了 \n') apple=int(input('请输入苹果的个数')) children=int(input('请输入来了多少个小朋友')) result=apple//children remain=apple 阅读全文
posted @ 2022-12-14 19:07 -Morgan- 阅读(13) 评论(0) 推荐(0)
摘要: Bmi bmi.py def fun_bmi(person,height,weight): print(person+'的身高'+str(height)+'米\t 体重:'+str(weight)+'千克') bmi=weight/(height*height) print(person+'的BMI 阅读全文
posted @ 2022-12-14 19:06 -Morgan- 阅读(23) 评论(0) 推荐(0)
摘要: Geese class Geese: '''大雁类''' def __init__(self,beak,wing,claw): print('我是大雁类!我有以下特征:') print(beak) print(wing) print(claw) def fly(self,state): print( 阅读全文
posted @ 2022-12-14 19:05 -Morgan- 阅读(11) 评论(0) 推荐(0)
摘要: Function_tips def function_tips(): import datetime mot=["今天星期一:\n坚持下去不是因为我很坚强,而是因为我别无选择。", "今天星期二:\n含泪播种的人一定能笑着收获。", "今天星期三:\n作对的事情比把事情做对更重要。", "今天星期四 阅读全文
posted @ 2022-12-14 19:05 -Morgan- 阅读(13) 评论(0) 推荐(0)
摘要: Programmer_splice programmer_1='程序员甲:搞IT太辛苦了,我想换行.....怎么办?' programmer_2='程序员乙:敲一下回车键' print(programmer_1+'\n'+programmer_2) Idcard programer_1='你知道我的 阅读全文
posted @ 2022-12-14 19:04 -Morgan- 阅读(16) 评论(0) 推荐(0)
摘要: """7段数码管绘制""" import turtle, datetimedef drawGap(): # 绘制数码管间隔 turtle.penup() turtle.fd(5) def drawLine(draw): # 绘制单段数码管 drawGap() turtle.pendown() if 阅读全文
posted @ 2022-12-08 19:42 -Morgan- 阅读(27) 评论(0) 推荐(0)
摘要: import pygame, syspygame.init()screenGameCaption = pygame.display.set_caption("Ball game")screen = pygame.display.set_mode([680, 480])screen.fill([255 阅读全文
posted @ 2022-12-01 20:44 -Morgan- 阅读(45) 评论(0) 推荐(0)
摘要: import datetime#定义一个列表mot = ["今天星期一:\n坚持下去不是因为我很坚强,而是因为我别无选择。", "今天星期二:\n含泪播种的人一定能笑着收获。", "今天星期三:\n做对的事情比把事情做对重要。", "今天星期四:\n命运给予我们的不是失望之酒,而是机会之杯。", " 阅读全文
posted @ 2022-09-29 14:08 -Morgan- 阅读(37) 评论(0) 推荐(0)
摘要: 1 print("今有物不知其数,三三数之剩二,五五数之剩三,七七数之剩二,问几何?\n")#输入一个数number = int(input("请输入您认为符合条件的数:"))#判断是否符合条件if number%3 == 2 and number%5 == 3 and number%7 == 2: 阅读全文
posted @ 2022-09-22 14:14 -Morgan- 阅读(69) 评论(0) 推荐(0)
摘要: 实例1 height = 1.81 print("您的身高: "+ str(height))weight = 64print("您的体重: "+ str(weight))bmi=weight/(height*height)print("您的BMI指数为: "+str(bmi))# 判断身材是否合理i 阅读全文
posted @ 2022-09-15 13:02 -Morgan- 阅读(34) 评论(0) 推荐(0)