@aleksey_mashanov

Как исправить ошибку AttributeError: module 'turtle' has no attribute 'shape'?

код:
import turtle
turtle.shape('turtle')
turtle.color('yellow')
turtle.begin_fill()
turtle.circle(50)
turtle.end_fill()
turtle.penup()
turtle.goto(0, 100)
turtle.pendown()
turtle.color('blue')
turtle.begin_fill()
turtle.circle(50)
turtle.end_fill()
turtle.penup()
turtle.goto(100, 0)
turtle.pendown()
turtle.color('red')
turtle.begin_fill()
turtle.circle(50)
turtle.end_fill()
turtle.penup()
turtle.goto(-100, 0)
turtle.pendown()
turtle.color('green')
turtle.begin_fill()
turtle.circle(50)
turtle.end_fill()
turtle.penup()
turtle.goto(0, -100)
turtle.pendown()
turtle.color('black')

ошибка:

turtle.shape('turtle')
AttributeError: module 'turtle' has no attribute 'shape'
  • Вопрос задан
  • 195 просмотров
Пригласить эксперта
Ответы на вопрос 1
@Vadimych1
Просто я.
Вам нужно обращаться не к модулю turtle, а к перу. Для начала его нужно создать:
pen = turtle.Pen()
И далее уже к перу применять методы.
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы