재원's 블로그

python turtle(파이썬 터틀 모듈) 이용해 사각형 그리기 본문

Python

python turtle(파이썬 터틀 모듈) 이용해 사각형 그리기

KimJ.W 2023. 1. 20. 19:08

최초 작성일 : 2021-11-25

 

Python에 있는 'turtle'모듈을 사용해서
사각형을 그려보았다.

코드는 아래와 같다.

```python
import turtle as t
t.shape('turtle')
t.forward(100)
t.right(9
t.forward(100)
t.right(90)
t.forward(100)
t.right(90)
t.forward(100)
```

'Python' 카테고리의 다른 글

class  (2) 2023.01.21
list comprehension  (0) 2023.01.20
matplotlib,seaborn 시각화 들어가기  (0) 2023.01.20
파이썬 기초문법  (0) 2023.01.20
Python Virtual Environments(파이썬 가상환경)  (0) 2023.01.20