Commit 18a1636c by BellCodeEditor

save project

parent d0b7bc8c
import turtle
pen=turtle.Pen()
pen.fillcolor("black")
pen.begin_fill()
pen.penup()
pen.goto(0,-200)
pen.pendown()
pen.circle(200,180)
pen.left(90)
pen.goto(0,-200)
pen.goto(0,0)
pen.right(90)
pen.end_fill()
pen.fillcolor("black")
pen.begin_fill()
pen.circle(100,180)
pen.end_fill()
pen.fillcolor("white")
pen.begin_fill()
pen.goto(0,0)
pen.circle(100,180)
pen.end_fill()
pen.pensize(3)
pen.circle(200,180)
pen.fillcolor("white")
pen.begin_fill()
pen.goto(0,-120)
pen.circle(30,360)
pen.end_fill()
pen.penup()
pen.fillcolor("black")
pen.begin_fill()
pen.goto(0,75)
pen.pendown()
pen.circle(30,360)
pen.end_fill()
pen.penup()
pen.goto(0,-200)
pen.pendown()
pen.circle(200,360)
turtle.done()
\ No newline at end of file
n=input()
print((20-len(n))//2*'='+n+(20-len(n))//2*'=')
s=input()
for i in s:
if i=="0":
print("零",end="")
elif i=="1":
print("一",end="")
elif i=="2":
print("二",end="")
elif i=="3":
print("三",end="")
elif i=="4":
print("四",end="")
elif i=="5":
print("五",end="")
elif i=="6":
print("六",end="")
elif i=="7":
print("七",end="")
elif i=="8":
print("八",end="")
elif i=="9":
print("九",end="")
n=int(input())
print(n+n)
\ No newline at end of file
s=input()
print()
dict_hero={'a':1,'b':2,'c':3}
print(dict_hero)
print(dict_hero['a'])
dict_hero['c']=4
dict_hero['d']=5
print(dict_hero)
import turtle
pen=turtle.Pen()
pen.penup()
pen.goto(-150,-200)
pen.pendown()
pen.goto(100,-200)
pen.left(90)
pen.goto(100,0)
pen.left(90)
pen.goto(-150,0)
pen.right(90)
pen.goto(-150,-200)
pen.fillcolor("blue")
pen.begin_fill()
pen.penup()
pen.goto(0,-100)
pen.pendown()
pen.circle(30,360)
pen.end_fill()
pen.fillcolor("blue")
pen.begin_fill()
pen.penup()
pen.goto(100,-100)
pen.pendown()
pen.circle(30,360)
pen.end_fill()
pen.fillcolor("blue")
pen.begin_fill()
pen.penup()
pen.goto(-90,-100)
pen.pendown()
pen.circle(30,360)
pen.end_fill()
turtle.done()
\ No newline at end of file
dict={'旺仔牛奶':4,'农夫山泉':1,'辣条':3,'巴西烤肉':2,'果冻':4,'乐事':5,'奥利奥':10,'巧克力':6}
k=input('你想买什么呀?')
if k in dict
print('叮咚~您的'+k+'需要支付'+str(dict[k])+'元~')
else:
print('神奇百货暂未有你想要的物品,敬请期待~')
dict={'旺仔牛奶':4,'农夫山泉':1}
for k in dict.keys():
print(k,end=" ")
for k in dict.values():
print(k,end=" ")
for k,v in dict.items():
print(k,v,end=" ")
\ No newline at end of file
import turtle
pen=turtle.Pen()
pen.fillcolor("black")
pen.begin_fill()
pen.penup()
pen.goto(-200,-300)
pen.pendown()
pen.goto(300,-300)
pen.goto(300,200)
pen.left(180)
pen.goto(-200,200)
pen.left(90)
pen.goto(-200,-300)
pen.end_fill()
pen.fillcolor("red")
pen.begin_fill()
pen.penup()
pen.goto(50,-300)
pen.pendown()
pen.goto(300,-50)
pen.goto(50,200)
pen.goto(-200,-50)
pen.goto(50,-300)
pen.end_fill()
pen.penup()
pen.goto(-80,75)
pen.pendown()
pen.fillcolor("blue")
pen.begin_fill()
pen.forward(250)
pen.left(90)
pen.forward(250)
pen.left(90)
pen.forward(250)
pen.left(90)
pen.forward(250)
pen.left(90)
pen.end_fill()
pen.penup()
pen.goto(45,75)
pen.pendown()
pen.fillcolor("yellow")
pen.begin_fill()
pen.right(45)
pen.forward(180)
pen.left(90)
pen.forward(180)
pen.left(90)
pen.forward(180)
pen.left(90)
pen.forward(180)
pen.end_fill()
pen.hideturtle()
turtle.done()
\ No newline at end of file
import turtle
pen=turtle.Pen()
pen.pensize(3)
pen.penup()
pen.goto(0,-120)
pen.pendown()
pen.right(20)
pen.circle(140,90)
pen.right(-90)
pen.circle(140,90)
pen.right(216)
pen.right(20)
pen.circle(140,90)
pen.right(-90)
pen.circle(140,90)
pen.right(220)
pen.right(20)
pen.circle(140,90)
pen.right(-90)
pen.circle(140,90)
pen.right(216)
pen.right(20)
pen.circle(140,90)
pen.right(-90)
pen.circle(140,90)
pen.right(216)
pen.right(20)
pen.circle(140,90)
pen.right(-90)
pen.circle(140,90)
pen.fillcolor('pink')
pen.end_fill()
turtle.done()
\ No newline at end of file
a={'小张':70,'小王':80,'小李':90}
k=input('请输入姓名')
v=input('请输入成绩')
if k in a:
if int(v)>a[k]:
a[k]= int(v)
print(k+'涨高了,现在'+v+'分')
else:
print(k+'降低了,继续努力')
else:
a[k]=int(v)
print(k+'的成绩'+v+'分已上传')
weather={'北京':8,'上海':15,'广州':20,'深圳':21}
data=weather.pop("北京")
print(data)
print(weather)
dict={'北京':8,'上海':15,'广州':20,'深圳':21}
for k in dict.keys():
print(k,end=" ")
print()
for k in dict.values():
print(k,end=" ")
print()
for k,v in dict.items():
print(k,v,end=" ")
print()
data=dict.pop('北京')
print(data)
print(dict)
text1={1:'一',2:'二',3:'三'}
text2={4:'四',5:'五',6:'六'}
text3={7:'七',8:'八',9:'九'}
dict_1={'a':text1,'b':text2,'c':text3}
name = input("名字:")
x=dict_1[name]
for k in x.keys():
print(k,end=' ')
print()
for v in x.values():
print(v,end=' ')
print()
for k,v in x.items():
print(k,v,end=' ')
\ No newline at end of file
import turtle
pen=turtle.Pen()
pen.fillcolor("red")
pen.begin_fill()
pen.penup()
pen.goto(-180,-100)
pen.right(90)
pen.pendown()
pen.pensize(5)
pen.pencolor("green")
pen.circle(200,180)
pen.pensize(5)
pen.pencolor("black")
pen.left(90)
pen.goto(-180,-100)
pen.end_fill()
pen.hideturtle()
turtle.done()
\ No newline at end of file
import turtle
pen=turtle.Pen()
pen.penup()
pen.goto(0,-200)
pen.pendown()
pen.circle(200,180)
pen.left(90)
pen.goto(0,-200)
pen.left(135)
pen.goto(200,0)
pen.goto(0,200)
pen.end_fill()
pen.hideturtle()
turtle.done()
\ No newline at end of file
n=input()
print(n)
n=int(input())
if n%2==0:
print(0)
if n%2!=0:
print(1)
\ No newline at end of file
n=int(input())
sum=0
for i in range(1,n+1):
sum=sum+i
print(sum)
n=input()
print(len(n))
\ No newline at end of file
n=input()
print((15-len(n))*"*"+n)
\ No newline at end of file
# 持家小能手 (利用自动更新成绩程序的逻辑完成这个新项目)
# 如果输入的水果价钱比字典中的低,则替换掉,反之则不更新
cost= {'苹果':5.2,'山竹':12.9,'香蕉':2.4,'荔枝':15,'葡萄':9.3,'桂圆':8,'蓝莓':10,'李子':8}
k=input('请输入水果名称:')
v=input('请输入水果价钱:')
if k in cost:
if float(v)< cost[k]:
cost[k]= float(v)
print(k+'降价了,现价'+v+'元')
else:
print(k+'涨价了,我们不买')
else:
cost[k] = float(v)
print(k+'的价钱'+v+'元已上传~')
......@@ -2,7 +2,6 @@ student1 = {'语文':91,'数学':88,'英语':85}
student2 = {'语文':97,'数学':98,'英语':90}
student3 = {'语文':95,'数学':100,'英语':93}
score={'悟空':student1 ,'诺依':student2,'小贝':student3}
name = input("名字:")
print("*"*30)
if name in score:
......
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