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
6b1d4280
authored
Jun 06, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
4b1e2cc0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
9 deletions
__pycache__/func.cpython-37.pyc
diy.py
diy1.py
func.py
__pycache__/func.cpython-37.pyc
0 → 100644
View file @
6b1d4280
File added
diy.py
View file @
6b1d4280
try
:
import
func
age
=
int
(
input
(
"你今年几岁"
))
except
:
list1
=
func
.
new_input
()
print
(
'要输入整数'
)
print
(
func
.
sum
(
list1
))
print
(
"程序结束"
)
\ No newline at end of file
diy1.py
0 → 100644
View file @
6b1d4280
def
hello
(
name
):
content
=
"你好"
+
name
return
content
result
=
hello
(
"小易"
)
print
(
result
)
func.py
View file @
6b1d4280
def
func
():
def
new_input
():
total
=
[]
total
=
[]
while
True
:
while
True
:
try
:
try
:
...
@@ -9,6 +9,14 @@ def func():
...
@@ -9,6 +9,14 @@ def func():
total
.
append
(
int
(
unit
))
total
.
append
(
int
(
unit
))
except
:
except
:
print
(
"只能输入数字或q"
)
print
(
"只能输入数字或q"
)
print
(
total
)
return
total
func
()
def
sum
(
money
):
count
=
0
for
i
in
money
:
count
+=
i
return
count
# list1 = new_input()
# result = sum(list1)
# print(result)
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