Предмет: Информатика, автор: dokash2010

Ребята помогите пожалуйста картинка гриба с помощю кода в Python если не знаете ответ не пишите


Аноним: нормально задачу сформулируй для начала
knodr75: Ему надо с помощью-какого либо модуля нарисовать гриб, с помощью кода
dokash2010: о ти привет
dokash2010: так теперь поможеш за 70 балов
knodr75: Вопрос удалят
knodr75: Ты спросил вопрос за баллы, которые получил за счет спама

Ответы

Автор ответа: anonymous2009
0

Ответ:

from turtle import *

def drawCircle(t, radius, input_color):

''' draw a circle of specified radius and color'''

t.color(input_color)

t.pensize(5)

t.circle(radius)

def fillCircle(t, radius, border_color, fill_color):

'''fill a circle with specified radius and border color/fill color'''

t.begin_fill ()

drawCircle (t, radius, border_color)

t.fillcolor (fill_color)

t.end_fill ()

def drawArc(t, radius, degree, fill_color):

'''draw a semicircle with specific radius, arc, and fill color'''

t.begin_fill()

t.circle(radius, degree) # ??? I'm not sure if it is right.

t.fillcolor (fill_color)

t.end_fill()

def drawRectangle(t, length, width, fill_color):

'''draw a triangle with specified lenght and color'''

t.begin_fill()

t.color (fill_color)

t.fd (length)

t.lt (90)

t.fd (width)

t.lt (90)

t.fd (length)

t.lt (90)

t.fd (width)

t.fillcolor (fill_color)

t.end_fill()

def initDraw (pen_shape, pen_size, pen_color, pen_speed):

'''create a turtle object with specific parameters '''

t.shape (pen_shape)

t.pensize(pen_size)

t.color (pen_color)

t.speed (pen_speed)

def draw(t):

'''functions to draw a mushroom'''

drawArc(t, radius, degree, fill_color)

drawRectangle(t, length, width, fill_color)

fillCircle(t, radius, border_color, fill_color)

# test driver code

t = Turtle()

initDraw("turtle", 3, "red", 10)

t.up()

t.goto(135, 60)

t.lt(100)

t.down ()

drawArc(t, 160, 160, "red")

t.up()

t.goto(-50, 59)

t.lt(10)

t.down ()

drawRectangle(t, 150, 60, "yellow")

t.up()

t.goto(-120, 100)

t.lt(10)

t.down ()

fillCircle(t, 12, "white", "white")

t.up()

t.goto(90, 100)

t.lt(10)

t.down ()

fillCircle(t, 12, "white", "white")

t.up()

t.goto(-30, 120)

t.lt(10)

t.down ()

fillCircle(t, 12, "white", "white")

t.up()

t.goto(-90, 150)

t.lt(10)

t.down ()

fillCircle(t, 12, "white", "white")

t.up()

t.goto(40, 150)

t.lt(10)

t.down ()

fillCircle(t, 12, "white", "white")

t.up()

t.goto(- 170, -200)

t.down ()

initDraw("turtle", 3, "blue", 10)

t.write ("Hi, I am the proud creation of this mushroom :o", font=("Calibri", 14, "normal"))

t.up()

initDraw("turtle", 3, "red", 10)

t.goto (-230, -230)

t=initDraw()

draw(t)

exitonclick()

Похожие вопросы
Предмет: Английский язык, автор: dollli
СРОЧНО!!! ДАЮ 24 БАЛЛА!! ПОМОГИТЕ, ПОЖАЛУЙСТА!!
Mark and Sarah are continuing the conversation. Put in the verbs. Use will or the Present Simple.

Sarah: If …you take.... (you /take) a train, …it'll be...... (jt/ be) much more comfortable.

If (1).............................................(you / need) a car, you can hire one when

(2).............................................(you / get) to Glasgow.

Mark: If (3).............................................(I / hire) a car, (4).............................................(it/be) too complicated. I'd

rather take my own.

Sarah: It's too dangerous. You might fall asleep on the motorway.

Mark: I won't fall asleep. I can play loud music. Anyway, (5).............................................(I / get) there much

quicker when (6).............................................(there / be) no traffic on the road. As soon as

(7).............................................(I / arrive), (8).............................................(I / ring) you, I promise.

Sarah: (9).............................................(I / be) worried until (10)............................................. (I / hear) from you. But

don't ring before (11).............................................(I / be) awake in the morning.

Mark: (12).............................................(I / lie) down for a couple of hours before

(13).............................................(I/go).

Sarah: Good idea. (14).............................................(you / be) exhausted tomorrow if

(15).............................................(you / not / get) some sleep this evening.