Commit 48b05909 by BellCodeEditor

save project

parent 9519ff71
Showing with 6 additions and 0 deletions
total = [] total = []
def ____(): def ____():
global a
global unit global unit
global total global total
a=0
while True: while True:
try: try:
unit= input("请输入:") unit= input("请输入:")
...@@ -9,6 +11,7 @@ def ____(): ...@@ -9,6 +11,7 @@ def ____():
break break
else: else:
total.append(float(unit)) total.append(float(unit))
a+=1
except ValueError: except ValueError:
print("请填写数字!") print("请填写数字!")
finally: finally:
...@@ -18,6 +21,8 @@ def __(_): ...@@ -18,6 +21,8 @@ def __(_):
for i in _: for i in _:
num+=i num+=i
print(num) print(num)
nm=num/a
print(nm)
____() ____()
print(total) print(total)
__(total) __(total)
\ 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