Python Day 2 Star List Colors

preview_player
Показать описание
Adds Dynamic Color using Lists to Five Point Star
Python 30 Day Coding Challenge
Coding and Math
STEM STEAM
Рекомендации по теме
Комментарии
Автор

Hi, Mike and Ashley! I know it's not as mathy, but did you know there's a "pos()" function in the turtle module? That way you can just save the locations the first time you go to 'em and return (in a different order) like this:


from turtle import *
speed(0)


locs = []


for i in range(5):
fd(100)
locs.append(pos()) #puts current location in locs list
rt(144)

for i in [2, 0, 3, 1, 4]: #different order this time
goto(locs[i])

peterfarrell