Lesson 1: First lines
이 페이지는 최신 브라우저(SharedArrayBuffer 지원)가 필요합니다. Chrome, Edge, Firefox 또는 Safari를 최신 버전으로 업데이트해 주세요.
English
Meet the turtle
- In Python, a turtle is a small arrow with a pen.
- It walks on the screen and draws a line behind it.
- This is real Python: the same code works in IDLE on your computer at home.
Words for this lesson
| Word | Meaning |
|---|---|
| forward | walk ahead in the direction the turtle faces |
| left / right | turn on the spot, by an angle in degrees |
| degree | a full turn is 360 degrees; a corner of a square is 90 |
English
Walk and turn
forward(100)walks 100 steps.left(90)turns a quarter turn.- The turtle starts in the middle, looking right.
import turtle
turtle.forward(100)
turtle.left(90)
turtle.forward(50)
- Press Run: the turtle draws an L shape.
난이도 1/5 · 100코인 + 오늘 첫 완료 시 작은 보너스 추가
Draw a square with sides of 100 steps. The turtle must end where it started.
출력을 보려면 '실행'을 클릭하세요.
난이도 2/5 · 140코인 + 오늘 첫 완료 시 작은 보너스 추가
Draw a rectangle: 150 steps wide and 80 steps tall. End where you started.
출력을 보려면 '실행'을 클릭하세요.