Lesson 10: Draw a house
หน้านี้ต้องใช้เบราว์เซอร์ล่าสุด (รองรับ SharedArrayBuffer) กรุณาอัปเดต Chrome, Edge, Firefox หรือ Safari เป็นเวอร์ชันล่าสุด
English
Your own picture
- Put it all together: functions, loops, colours and fills.
- Plan first: what shapes make a house? A square, a triangle, a small rectangle.
Words for this lesson
| Word | Meaning |
|---|---|
| plan | decide the steps before you write code |
| position | where the turtle is: goto(x, y) moves it there |
English
Move without drawing
import turtle
def jump(x, y):
turtle.penup()
turtle.goto(x, y)
turtle.pendown()
jump(-50, 0)
turtle.circle(20)
jump(50, 0)
turtle.circle(20)
- Use a
jumpfunction like this between the parts of your picture.
ความยาก 3/5 · 200 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Draw a house: a filled square wall (size 150), a filled triangle roof on top, and a door. Use at least 3 colours.
คลิก Run เพื่อดูผลลัพธ์ที่นี่
ความยาก 3/5 · 200 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Free drawing! Make any picture you like with at least one loop, 3 colours and 40 lines. Save it with Save picture.
คลิก Run เพื่อดูผลลัพธ์ที่นี่