Commit 5488e1e0 by BellCodeEditor

auto save

parent fa4605c8
____________________________________________________________________________-——-----------------------------------------------------——————-————————————————————————----------------——----------------_______________________________-----________________________________________-________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
\ No newline at end of file
...@@ -13,6 +13,5 @@ print(list_hero) ...@@ -13,6 +13,5 @@ print(list_hero)
# 请注释掉上面的代码,并在下一行创建一个名为dict_hero的字典 # 请注释掉上面的代码,并在下一行创建一个名为dict_hero的字典
dict_hero={'猴三':10,'猴一':21,'猴五':22,'猴队长':29,"猴七":30} dict_hero={'猴三':10,'猴一':21,'猴五':22,'猴队长':29,"猴七":30}
dict_hero['猴五']=100 dict_hero['猴五']=100
dict_hero['猴王']=300 print(dict_hero['猴七'])
print(dict_hero)
import ty
data=ty.new_input()
score=ty.count(data)
print("总分是"+str(score))
\ No newline at end of file
file1=open(r'C:\Users\cc\Desktop\test.txt','w',encoding='utf-8')
file1.write('改好价格')
file1.close()
def new_input():
list1=[]
while True:
data=input("请输入一个数字")
if data=="stop":
break
else:
try:
data_1=int(data)
except:
print("请输入一个数字")
else:
list1.append(data_1)
print(list1)
return(list1)
new_data=new_input()
print(new_data)
def count(new_data):
total=0
for i in new_data:
total=total+i
print(total)
return(total)
count(new_data)
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