Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson2-1-1_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
b93e88a9
authored
Dec 03, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
7c39e628
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
8 deletions
diy.py
diy.py
View file @
b93e88a9
# s是一个0至100的随机数
if
s
%
2
==
0
:
# 如果s对2取余等于0,那么s就是一个偶数
print
(
s
,
1
)
print
(
"这是一个偶数"
,
2
)
else
:
#否则,s就是一个奇数
print
(
s
,
1
)
print
(
"这是一个奇数"
,
2
)
\ No newline at end of file
num
=
input
(
"输入一个整数"
)
num1
=
int
(
num
)
if
num1
%
2
==
0
:
shu
=
"偶数"
else
:
shu
=
"奇数"
print
(
"你输入的数字是"
)
i
=
1
while
i
<=
9
:
for
j
in
range
(
1
,
i
+
1
{
i
*
j
})
print
(
f
"(i)*(j)={i*j}"
,
end
=
""
)
i
+=
1
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