#python #anaconda #jupyter-notebook #visual-code #html #css #javascript #http

제목module 실습자료에서 turtle을 사용하는 부분이 이상합니다.2020-04-06 01:31
작성자

from turtle import *
color('red', 'yellow')
begin_fill()
while True:
    forward(200)
    left(170)
    if abs(pos()) < 1:
        break
end_fill()
done()


위의 turtle 코드가 실습자료에 올라온 것인데 

IDLE를 사용하면 정상적으로 작동되지만

jupyter 를 사용하면 


NameError                                 Traceback (most recent call last)
<ipython-input-3-e3d76fcf88bc> in <module>
----> 1 from turtle import *
      2 color('red', 'yellow')
      3 begin_fill()
      4 while True:
      5     forward(200)

~Desktop과제 제출웹프로그래밍web python 과제 제출turtle.py in <module>
      1 from turtle import *
----> 2 color('red', 'yellow')
      3 begin_fill()
      4 while True:
      5     forward(200)

NameError: name 'color' is not defined 이와 같은 오류가 뜹니다. 무엇이 문제일까요?  

댓글