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
6e46a57c
authored
Jul 22, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
d9e5f296
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
67 additions
and
23 deletions
2.PY
5.py
50.py
58.py
func.py
2.PY
View file @
6e46a57c
try
:
total
=
[]
age
=
int
(
input
(
"你今年几岁"
))
def
sum
():
except
:
con
=
0
print
(
"输入整数"
)
while
True
:
else
:
unit
=
input
(
"输入:"
)
if
age
>
18
:
if
unit
==
" "
:
print
(
'不可以喝酒'
)
break
print
(
"结束"
)
try
:
\ No newline at end of file
int
(
unit
)
except
:
print
(
"输入合法字符"
)
else
:
total
.
append
(
unit
)
for
i
in
sum
:
con
=
con
+
i
return
con
result
=
sum
()
print
(
result
)
\ No newline at end of file
5.py
0 → 100644
View file @
6e46a57c
unit
=
input
(
"输入:"
)
if
unit
==
" "
:
break
else
:
try
:
int
(
unit
)
except
:
print
(
"输入合法字符"
)
else
:
total
.
append
(
unit
)
\ No newline at end of file
50.py
0 → 100644
View file @
6e46a57c
def
hello
(
name
):
content
=
"你好"
+
name
return
content
result
=
hello
(
"小于"
)
print
(
result
)
\ No newline at end of file
58.py
0 → 100644
View file @
6e46a57c
con
=
0
total
=
[]
def
new
():
while
True
:
unit
=
input
(
"输入:"
)
if
unit
==
" "
:
break
else
:
try
:
int
(
unit
)
except
:
print
(
"输入合法字符"
)
else
:
total
.
append
(
unit
)
def
sum
():
for
i
in
total
:
con
=
con
+
i
return
con
sum
()
print
(
con
)
\ No newline at end of file
func.py
View file @
6e46a57c
def
d
():
def
num
(
price
):
total
=
[]
content
=
content
+
price
while
True
:
return
content
unit
=
input
(
"请输入:"
)
result
=
num
()
if
unit
==
'q'
:
print
(
result
)
break
num
()
try
:
int
(
input
(
"菜名"
))
except
:
print
(
"输入菜名"
)
else
:
print
(
"total"
)
d
()
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