Lesson 6: Circles and dots
تحتاج هذه الصفحة إلى متصفح حديث (يدعم SharedArrayBuffer). يرجى تحديث Chrome أو Edge أو Firefox أو Safari إلى أحدث إصدار.
English
Round shapes
circle(50)draws a circle with radius 50. The turtle starts at the bottom of it.dot(20)draws a filled dot, 20 steps wide, where the turtle stands.penup()lifts the pen: the turtle moves without drawing.pendown()puts it back.
Words for this lesson
| Word | Meaning |
|---|---|
| radius | the distance from the centre of a circle to its edge |
| pen up / pen down | stop drawing / start drawing again |
English
Three rings
import turtle
for r in [30, 60, 90]:
turtle.penup()
turtle.goto(0, -r)
turtle.pendown()
turtle.circle(r)
goto(0, -r)puts the turtle at the bottom of each ring, so the rings share a centre.
الصعوبة 2/5 · 140 عملة + مكافأة صغيرة عند الإنجاز الأول اليوم
Draw a target: 4 circles with the same centre and radius 20, 40, 60 and 80.
اضغط تشغيل لرؤية المخرجات هنا.
الصعوبة 2/5 · 140 عملة + مكافأة صغيرة عند الإنجاز الأول اليوم
Draw a row of 6 dots, 40 steps apart, without lines between them.
اضغط تشغيل لرؤية المخرجات هنا.