메인
home
소프트웨어
home
🥎

9강. 랜덤 함수 활용 터틀

goto 함수는 원하는 좌표(X, Y) 로 가게 한다.

from turtle import * import random as rd speed(20) colormode(255) for ii in range(4000) : r = rd.randint(0, 255) g = rd.randint(0, 255) b = rd.randint(0, 255) k = rd.randint(20, 80) penup() goto(x, y) pendown() color(r, g, b) begin_fill() circle(k) end_fill()
Python
복사