Commit 55dd6a1c by BellCodeEditor

auto save

parent 0db28b07
...@@ -6,6 +6,7 @@ hero=['赵一',30,'丁二',37,'孙五',52,'王猛',89,'周亮',98] ...@@ -6,6 +6,7 @@ hero=['赵一',30,'丁二',37,'孙五',52,'王猛',89,'周亮',98]
# 自动排序 # 自动排序
for i in range(len(hero)): for i in range(len(hero)):
if i%2==1 and hero[i]>=power: if i%2==1 and hero[i]>=power:
hero.insert(i-1,name) hero.insert(i-1,name)
hero.insert(i,power) hero.insert(i,power)
print(hero) break
\ No newline at end of file print(hero[-6: ])
def new_input():
total=[]
while True:
data=input("请输入价格")
if data=="s":
break
else:
try:
data1=int(data)
except:
print("请输入数字")
else:
total.append(data1)
return total
result1=new_input()
#print(result1)
def count(list):
a=0
for i in list:
a=a+i
#print("价格总和是"+str(a))
return a
result2=count(result1)
print(result2)
def new_input():
total=[]
while True:
data=input("请输入价格")
if data=="s":
break
else:
try:
data1=int(data)
except:
print("请输入数字")
else:
total.append(data1)
print(total)
return total
a=new_input()
print(a)
import turtle
import k
h=k.new_input()
g=k.count(h)
print("成绩是"+str(g))
\ 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