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
86e7660d
authored
Feb 18, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
5f8ae778
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
11 deletions
Autumn.py
Spring.py
Summer.py
Winter.py
func.py
Autumn.py
0 → 100644
View file @
86e7660d
def
sum
(
a
):
s
=
0
for
i
in
range
(
a
+
1
):
s
=
s
+
i
return
s
result
=
sum
(
3
)
print
(
result
)
\ No newline at end of file
Spring.py
0 → 100644
View file @
86e7660d
def
max
(
a
,
b
):
if
a
>
b
:
return
a
else
:
return
b
result
=
max
(
6
,
7
)
print
(
result
)
\ No newline at end of file
Summer.py
0 → 100644
View file @
86e7660d
def
sum
(
x
,
y
):
s
=
x
+
y
return
s
result
=
sum
(
3
,
5
)
print
(
result
)
\ No newline at end of file
Winter.py
0 → 100644
View file @
86e7660d
s
=
0
while
True
:
num
=
input
(
"请输入整数(q结束)"
)
if
num
==
"q"
:
break
try
:
int_sum
=
int
(
num
)
except
:
print
(
"无效字符,请重新输入一个整数!"
)
else
:
s
=
s
+
int_sum
print
(
"输入数字的总和为:"
,
s
)
\ No newline at end of file
func.py
View file @
86e7660d
def
new_input
():
total
=
[]
while
True
:
unit
=
input
(
'请输入(s退出)'
)
if
unit
==
's'
break
else
:
tolal
.
append
(
unit
)
print
(
total
)
new_input
()
\ No newline at end of file
"C:
\
Program Files (x86)
\
Tencent
\
WeChat"
\ 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