Commit b7e7dde6 by BellCodeEditor

save project

parent 26adcaf8
Showing with 19 additions and 0 deletions
#获取指定元素出现次数
verse=["啊","是","去","额","他","他"]
num=verse.count("他")
print(num)
#获取指定元素首次出现下标
verse=["啊","是","去","额","他","他"]
position=verse.index("他")
print(position)
#统计数值列表元素和
wasb=[111,222,333,444,555,666,777]
ssss=sum(wasb)
print(ssss)
#
grade=[111,222,333,444,555,666,777]
grade.sort()
print("升序:",grade)
grade.sort(reverse=True)
print("降序:",grade)
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