Commit ee199308 by BellCodeEditor

auto save

parent b5758fba
Showing with 37 additions and 4 deletions
import random
a = "python"
print(a[-3])
\ No newline at end of file
# import random
# 私钥
key = "abcdefgh使用编程实现位移替换加密,制作密码机关真是太好玩了哈哈!"
# 要加密语句
message = "诺依,周末一起去看动漫展吧!"
# 加密后的语句(密文)
key_message = ""
# 加密过程
for i in message:
str1 = i
str2 = random.choice(key)
str3 = random.choice(key)
text = str1+str2+str3
key_message = key_message + text
print(key_message)
goods = {'可口可乐':3,'旺仔牛奶':4,'农夫山泉':1,'辣条':3,'巴西烤肉':2,'果冻':4,'乐事':5,'奥利奥':10,'巧克力':6} name = "刘强"
goods.pop("农夫山泉") power = 66
print(good) hero = ['赵一',30,'丁二',37,'孙五',52,'王猛',89,'周亮',98]
# 请将"农夫山泉"删掉,并打印出新的商品信息
for i in range(len(hero)):
if i%2==1 and hero[i]>=power:
hero.insert(i-1,name)
hero.insert(i,power)
break # 结束循环 continue 结束本次循环,进入下一次循环
print(hero)
a = hero[-6:] # 最强三人。切片
print(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