Commit 77f78c33 by BellCodeEditor

save project

parent ee79f384
weather={'北京':8,'上海':15,'广州':20,'深圳':21}
data=weather.pop('北京')
print(data)
print(weather)
\ No newline at end of file
# 玩家出拳 # 玩家出拳
player=input("出什么?") player=input("出什么?")#询问玩家出什么
print("玩家出:"+player) print("玩家出:"+player)#打印玩家出的
# 计算机出拳 # 计算机出拳
import random import random#打开随机数模块
list = ["石头","剪刀","布"] list = ["石头","剪刀","布"]#列表list
choice = random.choice(list) choice = random.choice(list)#在列表list中随机抽一个
print("计算机出:"+choice) print("计算机出:"+choice)#打印计算机出的
if player==choice: if player==choice:#如果玩家的等于计算机的
print("平局") print("平局")#打印平局
elif (player=="石头" and choice=="剪刀")or(player=="剪刀" and choice=="布")or(player=="布" and choice=="石头"): elif (player=="石头" and choice=="剪刀")or(player=="剪刀" and choice=="布")or(player=="布" and choice=="石头"):
print("你赢了") print("你赢了")
else: else:
print("你输了") print("你输了")
\ No newline at end of file \ No newline at end of file
import turtle
#画文字
pen = turtle.Pen()
screen=turtle.Screen()
screen.bgcolor("pink")
pen.penup()
pen.goto(100,-100)
pen.write("三班荣耀,\n欢迎来玩!",font=("Times",30,"normal"))
pen.hideturtle()
#画爱心
len=int(screen.textinput("提示","你想要多大的爱心?"))
pen1=turtle.Pen()
pen1.pensize(5)
pen1.pencolor("red")
pen1.left(45)
pen1.fillcolor("red")
pen1.begin_fill()
pen1.forward(len*2)
pen1.circle(len,180)
pen1.right(90)
pen1.circle(len,180)
pen1.forward(len*2)
pen1.end_fill()
pen1.hideturtle()
turtle.done()
\ No newline at end of file
username='python'
userpassword='123456'
i=3
while True:
if i>0:
name=input("账号:")
password=input("密码:")
i-=1
if name == username and password == userpassword:
print("登录成功")
break
if name !=username:
print("账号有误,请重新输入")
print("温馨提示,您还有"+str(i)+"次机会。")
continue
if password !=userpassword:
print("密码有误,请重新输入")
print("温馨提示,您还有"+str(i)+"次机会。")
continue
else:
print("账号已锁定")
exit()
print("欢迎来到贝尔编程!")
\ No newline at end of file
import turtle
pen=turtle.Pen()
screen=turtle.Screen()
screen.bgcolor("black")
colors=["red","blue","yellow","green"]
pen.speed(0)
for i in range(1,450):
pen.pencolor(colors[i%4])
pen.forward(i)
pen.right(91)
pen.hideturtle()
turtle.done()
\ No newline at end of file
for i in range(1,10):
for j in range(1,i+1):
print(j,"x",i,"=",(j * i),end=" ")
print()
\ No newline at end of file
import random
keyganrao='色戒风格疤痕jsjzmvb'
key='sahagfvbagkjf,vcgkzcv借此机会的时候被车撞飞会不知所措'
message="薛子,周六一起去岚山根玩吧!"
key_message=''
for i in message:
str1=i
str2=random.choice(key)
str3=random.choice(key)
key_message=key_message+str1+str2+str3
li_list=list(key_message)
index=random.randint(0,len(li_list))
li_list.insert(index,keyganrao)
fin_str= ''.join(li_list)
print(fin_str)
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+'我们不卖')
\ No newline at end of file
goods={'农妇三拳':1}
goods.pop('农妇三拳')
print(goods)
\ 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