Commit c5b46fb8 by BellCodeEditor

save project

parent 17f8890d
Showing with 30 additions and 3 deletions
b=["张飞","关羽","刘备","曹操","袁术","诸葛亮"]
b.pop(3)
b.pop(-2)
b.remove("诸葛亮")
print(b)
#添加
b=["张飞","关羽","刘备","曹操"]
b.append("袁术")
b.insert(3,"诸葛亮")
print(b)
#列表
a=["华雄"]
b=["张飞","关羽","刘备","曹操"]
a.extend(b)
print(a)
#列表
a=["华雄"]
b=["张飞","关羽","刘备","曹操","诸葛亮"]
a.extend(b[1:4])
print(a)
i = 5 # 行
j = 3 # 列
print(j,"*",i,"=",(j*i))# 使用变量i和j,代替乘法算式里面的元素,打印出单个乘法算式
name=input("你叫什么名字")
power=int(input("你的臂力是多少"))
d=["小亮",30,"小红",55,"小刚",67,"小黑",73,"小绿",99,]
for i in range(len(d)):
if i%2==1 and d[i]>=power:
d.insert(i-1,name)
d.insert(i,power)
break
print(d)
\ 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