Commit c48be3d9 by BellCodeEditor

auto save

parent 26b3b1d4
Showing with 34 additions and 0 deletions
......@@ -11,3 +11,6 @@ bro3=["张飞",166,8.3]
bros[0]="关羽"
bros[1]="刘备"
print(bros)
# 列表是根据索引取值,第一个元素的索引值是0
bro1.clear()
bro1.pop(0)
\ No newline at end of file
# 古代测量臂力是靠不同重量的石锁,只能测整数哦。
# 古代测量臂力是靠不同重量的石锁,只能测整数哦。
# 最小的石锁是30公斤最大的石锁是100公斤,注意输入的数字哦
# 问询处
# name=input('你叫啥名啊?')
# power=int(input('你臂力多少啊?'))
# 归档处
hero=['赵一',30,'丁二',30,37,'孙五',52,'王猛',89,'周亮',98,'张宇',100]
# for i in range(len(hero)):
# if i%2==1 and hero[i]>=power:
# hero.insert(i-1,name)
# hero.insert(i,power)
# break
# elif power>hero[-1]:
# hero.append(name)
# hero.append(power)
# break
# print(hero[-6:])
#增删改查
# 增
# hero.insert(1,"你好")
# hero.append("你好")
# hero_1 = [1,2,3,4,5,6]
# hero.extend(hero_1)
#删
# hero.pop(0)
# hero.remove(30)
#查
a = hero[-6:-2]
print(a)
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