Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson11_1
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
7400a929
authored
Dec 27, 2020
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
a7140056
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletions
func.py
func.py
View file @
7400a929
...
...
@@ -5,7 +5,13 @@ def new_input(): #这是定义函数
if
unit
==
'q'
:
break
else
:
total
.
append
(
unit
)
try
:
#判断会不会报告出错
unit
=
int
(
unit
)
except
:
#出错了才会执行
print
(
"你输入的不是数字,重新输入"
)
else
:
#正确了才会执行
total
.
append
(
unit
)
print
(
"-"
*
30
)
print
(
total
)
new_input
()
#这是调用函数
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment