Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
level3-lesson14-diy1
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
d1d207ef
authored
Feb 07, 2026
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
85402d73
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
14 deletions
diy1.py
diy1.py
View file @
d1d207ef
#定义一个函数sum_numbers()
#要求这个函数能接收一个名为num的整型参数
#要求这个函数能计算1+2+3+……+num的结果
aet
peacn
(
n
)
if
n
==
10
:
return
1
num
=
(
peanch
(
n
=
1
)
=
1
)
*
2
return
num
peanch_num
=
peanch
(
1
)
print
(
peach_num
)
\ No newline at end of file
a
=
input
(
"输入姓名"
)
b
=
input
(
"输入爱好"
)
c
=
input
(
"输入目标"
)
print
(
"姓名"
)
print
(
"a"
)
print
(
"爱好"
)
print
(
"b"
)
print
(
"目标"
)
print
(
"c"
)
a
=
input
(
'输入长方形的长:'
)
b
=
input
(
'输入长方形的宽:'
)
c
=
input
(
'输入长方形的高:'
)
v
=
float
(
a
)
*
float
(
b
)
*
float
(
c
)
print
(
"长方形的面积为:"
,
v
)
total
=
10
total
+=
5
total
+=
10
print
(
total
)
\ 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