Commit 55dd6a1c by BellCodeEditor

auto save

parent 0db28b07
...@@ -8,4 +8,5 @@ for i in range(len(hero)): ...@@ -8,4 +8,5 @@ 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