Commit 8347766d by BellCodeEditor

save project

parent b7ca92ee
list_hero=['赵一',30,'丁二',37,'孙五',52,'王猛',89,'周亮',98]
dict_hero = {'赵一':30,'丁二':37,'孙五':52,'王猛':89,'周亮':98}
print(len(list_hero))
print(len(dict_hero))
\ No newline at end of file
dict={"百事可乐":3,"果冻":1,"巧克力":2}
k=input("您想买什么呀?")
if k in dict:
print("叮咚~好的"+k+"需要花"+str(dict[k])+"元")
else:
print("抱歉,没有您想要的东西,敬请期待")
\ No newline at end of file
dict_monkey={"猴三":30,"后羿":60,"猴队长":100,"猴五":80}
print(dict_monkey)
dict_monkey["猴队长"]=30
print(dict_monkey)
\ No newline at end of file
name=input('你叫啥名啊?')
power=int(input('你臂力多少啊?'))
list_hero=['猴三',10,'猴一',21,'猴五',22,'猴队长',29,'猴七',30]
for i in range(len(list_hero)):
if i%2==1 and list_hero[i]>=power:
list_hero.insert(i-1,name)
list_hero.insert(i,power)
break
print(list_hero)
# 请注释掉上面的代码,并在下一行创建一个名为dict_hero的字典
dict_hero=
print(dict_hero)
\ No newline at end of file
import random
# 私钥
key = "abcdefgh使用编程实现位移替换加密,制作密码机关真是太好玩了哈哈!"
# 要加密语句
message =input("请输入:")
# 加密后的语句(密文)
key_message = ""
noise="$%^*&^@#^&*##&%$!"
# 加密过程
for i in message:
str1 = i
str2 = random.choice(key)
str3 = random.choice(key)
text = str1+str2+str3
key_message = key_message + text
index=random.randint(0,len(key_message))
list_message=list(key_message)
list_message.insert(index,noise)
result_message="".join(list_message)
print(result_message)
\ No newline at end of file
dict_monkey={"猴三":30,"后羿":60,"猴队长":100,"猴五":80}
print(dict_monkey)
dict_monkey["猴队长"]=30
print(dict_monkey)
\ No newline at end of file
dict={"百事可乐":3,"果冻":1,"巧克力":2}
k=input("您想买什么呀?")
if k in dict:
print("叮咚~好的"+k+"需要花"+str(dict[k])+"元")
else:
print("抱歉,没有您想要的东西,敬请期待")
\ No newline at end of file
# 这是悟空为花果山小猴做臂力测试的程序代码
name=input('你叫啥名啊?')
power=int(input('你臂力多少啊?'))
list_hero=['猴三',10,'猴一',21,'猴五',22,'猴队长',29,'猴七',30]
for i in range(len(list_hero)):
if i%2==1 and list_hero[i]>=power:
list_hero.insert(i-1,name)
list_hero.insert(i,power)
break
print(list_hero)
# 请注释掉上面的代码,并在下一行创建一个名为dict_hero的字典
dict_hero=
print(dict_hero)
# 这是悟空为花果山小猴做臂力测试的程序代码
# 这是悟空为花果山小猴做臂力测试的程序代码
name=input('你叫啥名啊?')
power=int(input('你臂力多少啊?'))
list_hero=['猴三',10,'猴一',21,'猴五',22,'猴队长',29,'猴七',30]
......@@ -9,5 +9,6 @@ for i in range(len(list_hero)):
break
print(list_hero)
# 请注释掉上面的代码,并在下一行创建一个名为dict_hero的字典
dict_hero=
dict_hero={'猴三',10,'猴一',21,'猴五',22,'猴队长',29,'猴七',30}
dict_hero.[]
print(dict_hero)
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