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
27957c42
authored
Dec 03, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
8989b4f2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
11 deletions
diy.py
diy.py
View file @
27957c42
import
turtle
# s是一个0至100的随机数
ink
=
input
(
"什么色?"
)
if
s
%
2
==
0
:
# 如果s对2取余等于0,那么s就是一个偶数
pen
=
turtle
.
pen
()
print
(
s
,
1
)
pen
.
fillcolor
(
ink
)
print
(
"这是一个偶数"
,
2
)
pen
.
begin
else
:
#否则,s就是一个奇数
for
i
in
range
(
5
)
print
(
s
,
1
)
pen
.
forward
(
200
)
print
(
"这是一个奇数"
,
2
)
pen
.
right
(
144
)
\ No newline at end of file
pen
.
end_fill
()
turtle
.
done
()
\ 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