Commit 8fe9a14c by BellCodeEditor

save project

parent 2ba95f50
Showing with 21 additions and 12 deletions
......@@ -5,5 +5,5 @@ try:
except:
print("请输入整数")
else:
a.append(int(b))
print(a)
\ No newline at end of file
a.append(b)
print(a)9
\ No newline at end of file
total = []
while True:
unit= input("请输入:")
if unit== 'q':
break
else:
total.append(unit)
print(total)
\ No newline at end of file
def nn():
total = []
while True:
unit= input("请输入:")
if unit== 'q':
break
else:
try:
int(unit)
except:
print("请输入整数")
else:
total.append(int(unit))
return total
mm=nn()
print(mm)
\ 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