Commit 16b19563 by BellCodeEditor

save project

parent 3506b9b2
list=["苹果","香蕉","西瓜","香蕉","桃子","香蕉"]
list.remove("西瓜")
list.pop(0)
list.pop(-1)
print(list)
\ No newline at end of file
i = 5 # 行 bor1="刘备"
j = 3 # 列 bor2="关羽"
# 使用变量i和j,代替乘法算式里面的元素,打印出单个乘法算式 bor3="张飞"
bors=["刘备","关羽","张飞"]
bor1=["刘备",161,9.1]
bor2=["关羽",160,8.5]
bor3=["张飞",166,8.3]
bors[0] = "关羽"
bors[1] = "刘备"
print(bors)
\ No newline at end of file
b=["袁术","夏侯惇","曹操","关羽"]
b.remove("关羽")
print(b)
a=["华雄"]
a.insert(1,"华雄")
print(a)
a=["华雄"]
c=["文丑","颜良"]
a.extend(c)
print(a)
\ No newline at end of file
a=["吕布"]
b=["袁术","公孙瓒","关羽","张飞","刘备","曹操"]
a.extend(b[2:5])
print(a)
\ No newline at end of file
name="刘强"
power=66
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
print(hero)
print(hero[6:12])
\ 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