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
bf592f05
authored
May 30, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
2d56f71c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
func.py
jgnfn.py
func.py
View file @
bf592f05
dft
func
():
dft
func
():
total
=
[]
total
=
[]
while
True
:
while
True
:
try
:
unit
=
input
(
"请输入:"
)
unit
=
input
(
"请输入:"
)
if
unit
==
'q'
:
if
unit
==
'q'
:
break
break
else
:
else
:
total
.
append
(
unit
)
total
.
append
(
int
(
unit
))
print
(
total
except
:
\ No newline at end of file
print
(
"只能输入整数或q"
)
print
(
total
)
func
()
jgnfn.py
View file @
bf592f05
...
@@ -2,4 +2,7 @@ try :
...
@@ -2,4 +2,7 @@ try :
age
=
int
(
input
(
"你今年几岁"
))
age
=
int
(
input
(
"你今年几岁"
))
except
:
except
:
print
(
"要输入整数"
)
print
(
"要输入整数"
)
else
:
if
age
<
18
:
print
(
'不可以喝酒'
)
print
(
"程序结束"
)
print
(
"程序结束"
)
\ 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