Commit ee80baf8 by BellCodeEditor

auto save

parent a9ebac69
"""
计算长方形的面积 并输出结果
"""
a=6 #a为长方形的长,并赋值为6
b=3 #b为长方形的宽,并赋值为3
s=a*b #s为长方形的面积,并用长方形面积公式S=a*b
print("长方形面积为:",str(s)) #输出长方形面积
a=input('请输入一个三位整数')
print('百:',int(a)//100,'十:',int(a)%100//10,"个:",int(a)%10,sep=" ")
\ No newline at end of file
import turtle
turtle.penup()
turtle.goto(0,-50)
turtle.pendown()
turtle.color('black','blue')
turtle.begin_fill()
turtle.circle(50)
turtle.end_fill()
turtle.penup()
turtle.goto(-100,100)
turtle.pendown()
turtle.color('black')
for i in range(4):
turtle.forward(200)
turtle.right(90)
turtle.penup()
turtle.goto(0,-50)
turtle.pendown()
turtle.color('blue')
turtle.done()
\ No newline at end of file
。pp
\ No newline at end of file
a=int(input('请输入长:'));b=int(input('请输入宽:'));print('面积是:',a*b,sep='');print('周长是:',(a+b)*2,sep='')
\ No newline at end of file
b={"1":"--星期一","2":"--星期二","3":"--星期三","4":"--星期四","5":"--星期五","6":"--星期六","7":"--星期天"}
while True:
try:
a=input("输入数字:")
print(a,b[a])
except:
print("sb输错了")
\ No newline at end of file
import turtle
turtle.bgcolor('black')
turtle.penup()
turtle.goto(0,-275)
turtle.pendown()
turtle.color('red','red')
turtle.begin_fill()
turtle.circle(275)
turtle.end_fill()
turtle.penup()
turtle.goto(0,-200)
turtle.pendown()
turtle.pencolor('white')
turtle.pensize(50)
turtle.circle(200)
turtle.penup()
turtle.goto(0,-100)
turtle.pendown()
turtle.color('blue','blue')
turtle.begin_fill()
turtle.circle(100)
turtle.end_fill()
turtle.penup()
turtle.goto(0,100)
turtle.left(-110)
turtle.pendown()
turtle.color('white','white')
turtle.begin_fill()
turtle.pensize(1)
turtle.forward(200)
turtle.left(144)
turtle.forward(200)
turtle.left(144)
turtle.forward(200)
turtle.left(144)
turtle.forward(200)
turtle.left(144)
turtle.forward(200)
turtle.left(144)
turtle.end_fill()
turtle.hideturtle()
turtle.done()
\ No newline at end of file
import turtle
turtle.color('blue')
turtle.fillcolor('yellow')
turtle.begin_fill()
turtle.circle(50)
turtle.end_fill()
turtle.forward(100)
turtle.color('red','aqua')
turtle.begin_fill()
turtle.circle(50)
turtle.end_fill()
turtle.done()
import turtle
turtle.penup()
turtle.goto(0,-25)
turtle.pendown()
turtle.begin_fill()
turtle.color('black','blue')
turtle.begin_fill()
turtle.circle(25)
turtle.end_fill()
turtle.penup()
turtle.goto(0,0)
turtle.right(180)
turtle.forward(50)
turtle.pendown()
turtle.penup()
turtle.forward(50)
turtle.pendown()
turtle.left(90)
turtle.forward(100)
turtle.left(90)
turtle.forward(200)
turtle.left(90)
turtle.forward(200)
turtle.left(90)
turtle.forward(200)
turtle.left(90)
turtle.forward(100)
turtle.penup()
turtle.goto(-25,0)
turtle.left(180)
turtle.done()
\ No newline at end of file
import turtle
turtle.bgcolor('orange')
turtle.speed(0)
turtle.pensize(10)
turtle.circle(100)
turtle.penup()
turtle.goto(-250,0)
turtle.pencolor('blue')
turtle.pendown()
turtle.circle(100)
turtle.penup()
turtle.goto(250,0)
turtle.pencolor('red')
turtle.pendown()
turtle.circle(100)
turtle.penup()
turtle.goto(-125,-125)
turtle.pencolor('yellow')
turtle.pendown()
turtle.circle(100)
turtle.penup()
turtle.goto(125,-125)
turtle.pencolor('green')
turtle.pendown()
turtle.circle(100)
turtle.hideturtle()
turtle.done()
# ™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™
\ No newline at end of file
e=[1,2,3,4,5,6,6,7,7]
a=set(1,2,3,4,5,6,6,7,7)
a="YUONXEUCGMCYU"
print(a.lower())
c="iuemchwiug"
print(c.upper())
sb="{1}+{2}={0}".format(2,3,5)
\ No newline at end of file
a={1,2,3,4,5}
b={1,2,3,4}
print(a)
\ No newline at end of file
a=[99,80,86,89,94,92,75,87,86,95]
b=max(a)
c=min(a)
a.remove(b)
a.remove(c)
w=sum(a)
o=w/len(a)
#print("去掉一个最高分:",b,"分,去掉一个最低分:"+c"分"",最后得分为:"o"分")
print("qdygzgf:{}f,qdygzdf{}f,zhdf{}zhdf:{}f".format(b,c,o))
\ No newline at end of file
a=input("输入数字:").split(",")
c=[]
print(a)
for i in a:
if len(i)==2 and i[0] !=i[1]:
c.append(i)
print(len(c))
import pygame
from pygame import locals from pygame import locals
pygame.init() # 初始化 pygame.init() # 初始化
...@@ -11,17 +11,46 @@ stop_img = pygame.image.load('stop.png') # 暂停按钮 ...@@ -11,17 +11,46 @@ stop_img = pygame.image.load('stop.png') # 暂停按钮
last_img = pygame.image.load('last.png') # 上一曲按钮 last_img = pygame.image.load('last.png') # 上一曲按钮
next_img = pygame.image.load('next.png') # 下一曲按钮 next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img = pygame.image.load('logo.png') # 中间logo logo_img = pygame.image.load('logo.png') # 中间logo
pygame music=pygame.mixer.music.load("歌曲4.ogg")
p=pygame.mixer.music
v=0.458
b=0
b2=stop_img
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
if eventp.type==pygame.QUIT: if event.type==pygame.QUIT:
continue exit()
if event.type==pygame.KEYDOWN:
if event.key==pygame.K_UP:
v+=0.2
if v>1:
v=1
p.set_volume(v)
if event.key==pygame.K_DOWN:
v-=0.2
if v<0:
v=0
p.set_volume(v)
if event.type==pygame.MOUSEBUTTONDOWN:
if b==0:
p.pause()
b2=play_img
b=1
else:
p.unpause()
b2=stop_img
b=0
if pygame.mixer.music.get_busy()==False:
pygame.mixer.music.play()
# 绘制画面 # 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景 screen.blit(bg_img, (0, 0)) # 填充背景
screen.blit(stop_img, (270, 330)) # 暂停按钮 screen.blit(b2, (270, 330)) # 暂停按钮
screen.blit(logo_img, (170, 60)) # 中间logo图 screen.blit(logo_img, (170, 60)) # 中间logo图
screen.blit(last_img, (120, 350)) # 上一曲 screen.blit(last_img, (120, 350)) # 上一曲
screen.blit(next_img, (420, 350)) # 下一曲 screen.blit(next_img, (420, 350)) # 下一曲
# 刷新画面 pygame.display.update()
pygame.display.update() \ No newline at end of file

12.1 KB | W: | H:

21.7 KB | W: | H:

play.png
play.png
play.png
play.png
  • 2-up
  • Swipe
  • Onion skin
a=input('请输入总秒数:')
print(int(a)//3600,int(a)%3600//60,int(a)%3600%60,sep=" ")
\ No newline at end of file
import turtle
turtle.speed(1)
turtle.penup()
turtle.goto(-90,90)
turtle.pendown()
turtle.color('black')
for i in range(4):
turtle.forward(180)
turtle.right(90)
turtle.color('black','yellow')
turtle.begin_fill()
turtle.forward(180)
turtle.goto(-90,-90)
turtle.goto(-90,90)
turtle.end_fill()
turtle.penup()
turtle.goto(90,90)
turtle.pendown()
turtle.color('black','red')
turtle.begin_fill()
turtle.goto(90,-90)
turtle.goto(-90,-90)
turtle.goto(90,90)
turtle.end_fill()
turtle.hideturtle()
turtle.done()
\ No newline at end of file
import turtle
turtle.pensize(5)
turtle.color('red')
turtle.begin_fill()
turtle.fillcolor('yellow')
turtle.circle(50,steps=6)
turtle.end_fill()
turtle.hideturtle()
turtle.done()
\ No newline at end of file
a=input("请输入gls:")
if int(a)<=3:
b=13
elif int(a)>3 and int(a)<15:
b=13+(int(a)-3)*2.3
else:
b=13+(int(a)-3)*3.45
print("grathta%.2f"%b)
\ No newline at end of file
while True:
a=input('请输入学生成绩:')
if int(a)<60:
print("不及格哦")
else:
if int(a)>=60 and int(a)<85:
print("™良好")
else:
print("耶优哦")
\ No newline at end of file
# print('温心提示:请输入纯数字,否则后果自负!')
a=input('a? ')
b=input('b? ')
while True:
# int=int-2
# print(int)
if a.isdecimal():
if int(a)<int(b):
print(a+'<'+b)
else:
if int(a)>int(b):
print(a+'>'+b)
else:
if int(a)==int(b):
print(a+'='+b)
else:
print('请输入纯数字!')
int=22
int=int-2
print(int)
a=input("请输入数字:")
print("Python出现的次数为:",a.count("Python"))
\ No newline at end of file
a=input("请输入:")
b=[]
# b.append(a)
for i in a:
if i>="0" and i<="9":
pass
else:
a.append(i)
print(a)
...@@ -14,6 +14,8 @@ logo_img = pygame.image.load('logo.png') # 中间logo ...@@ -14,6 +14,8 @@ logo_img = pygame.image.load('logo.png') # 中间logo
music=pygame.mixer.music.load("歌曲4.ogg") music=pygame.mixer.music.load("歌曲4.ogg")
p=pygame.mixer.music p=pygame.mixer.music
v=0.458 v=0.458
b=0
b2=stop_img
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
if event.type==pygame.QUIT: if event.type==pygame.QUIT:
...@@ -29,7 +31,16 @@ while True: ...@@ -29,7 +31,16 @@ while True:
if v<0: if v<0:
v=0 v=0
p.set_volume(v) p.set_volume(v)
if event.type==pygame.MOUSEBUTTONDOWN:
if b==0:
p.pause()
b2=play_img
b=1
else:
p.unpause()
b2=stop_img
b=0
...@@ -38,7 +49,7 @@ while True: ...@@ -38,7 +49,7 @@ while True:
# 绘制画面 # 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景 screen.blit(bg_img, (0, 0)) # 填充背景
screen.blit(stop_img, (270, 330)) # 暂停按钮 screen.blit(b2, (270, 330)) # 暂停按钮
screen.blit(logo_img, (170, 60)) # 中间logo图 screen.blit(logo_img, (170, 60)) # 中间logo图
screen.blit(last_img, (120, 350)) # 上一曲 screen.blit(last_img, (120, 350)) # 上一曲
screen.blit(next_img, (420, 350)) # 下一曲 screen.blit(next_img, (420, 350)) # 下一曲
......
b=input('123?')
a = input('???')
if b==1:
print(int(a)//3600,'小时')
print(int(a)//60,'分钟')
print(int(a),'秒')
else:
if b==2:
print(int(a)//60,'小时')
print(int(a),'分钟')
print(int(a)*60,'秒')
else:
print(int(a),'小时')
print(int(a)*60,'分钟')
print(int(a)*3600,'秒')
import turtle
turtle.left(45)
turtle.begin_fill()
turtle.circle(50,steps=4)
turtle.end_fill()
turtle.begin_fill()
turtle.circle(-50,steps=4)
turtle.end_fill()
turtle.left(-45)
turtle.forward(70)
turtle.left(45)
turtle.circle(50,steps=4)
turtle.goto(70,-70)
turtle.left(135)
turtle.forward(140)
turtle.left(-90)
turtle.forward(70);
turtle.hideturtle()
turtle.done()
\ No newline at end of file
a=input('请破解:')
\ No newline at end of file
while True:
while True:
a=input("请输入数字:")
lbqh={"1":"一","2":"二","3":"三","4":"四","5":"五","6":"六","7":"七","8":"八","9":"九"}
if int(a)<10 and int(a)>0:
print(lbqh[a])
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment