Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
python_study
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Minseong Kwon
python_study
Commits
8a311d22
Commit
8a311d22
authored
6 years ago
by
Minseong Kwon
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
831d0259
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
turtle practice.py
+64
-0
64 additions, 0 deletions
turtle practice.py
with
64 additions
and
0 deletions
turtle practice.py
0 → 100644
+
64
−
0
View file @
8a311d22
import
turtle
as
t
#거북이 모양으로 변경하기
t
.
shape
(
"
turtle
"
)
#삼각형그리기
#100만큼 앞으로 이동
t
.
forward
(
100
)
#왼쪽방향으로 120도 만큼 회전한다
t
.
left
(
120
)
#다시 앞으로 100만큼 이동한다
t
.
forward
(
100
)
t
.
left
(
120
)
t
.
forward
(
100
)
#원그리기
#펜을 들기
t
.
penup
()
#포지션 재설정하기
t
.
setposition
(
-
100
,
-
100
)
#다시 펜을 내린다
t
.
pendown
()
t
.
circle
(
50
)
#사각형그리기
t
.
penup
()
t
.
setposition
(
200
,
0
)
t
.
pendown
()
t
.
color
(
"
blue
"
)
#펜 색깔을 파란색으로 변경
t
.
pensize
(
5
)
#펜 굵기를 5로 변경
for
i
in
range
(
4
):
#아래 로직을 4번 반복
t
.
forward
(
100
)
#거북이가 100만큼 앞으로 이동
t
.
left
(
90
)
#오각형그리기
n
=
5
t
.
color
(
"
purple
"
)
#색을 보라색으로 지정
t
.
begin_fill
()
#색칠 영역시작
for
x
in
range
(
n
):
t
.
forward
(
50
)
t
.
left
(
360
/
n
)
t
.
end_fill
()
#색칠할 영역 마무리
t
.
hideturtle
()
#거북이를 숨긴다
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment