Use aColor as part of the computation in a for-Loop in a turtle Module to create a square. Once this program is run aColor will take on any of the attributes of the turtle. All of the for-Loop compound statement is executed completely before going to the next sequential statement. wn.exitonclick() will close the window (canvas) when the it is clicked on with the mouse.
You will need a device and an operating system that is compatible with the required storage for the download of the software.
Turtle Module (object) requires the installation of the latest version of Python 3.7.3 with the additional IDE of PyCharm to run code. OS systems include downloads for Windows, Linux/Unix, Mac OS X and other Platforms. See link below for complete details. If you do not have your own personal computer you can the interactive site Runestone Academy (link below)
import turtle #imports the turtle module, set up Lexi
wn = turtle.Screen() #creates the turtle window
wn.bgcolor("lightgreen") #canvas background lightgreen
lexi = turtle.Turtle() #creates turtle named lexi
for aColor in ["yellow","red", "purple", "blue"]: #applies each color attribute to lexi using for-Loop iteration
lexi.color (aColor)
lexi.forward(50) #moves lexi 50 pixels forward
lexi.left(90) #moves lexi 90 pixels left to complete square
wn.exitonclick()
https://www.python.org/download (Click the installation that applies to your OS.) https://www.jetbrains.com/pycharm/ https://www.runestone.academy/
Thans to Python Software Foundation, Runestone Academy, my instrucotr Zak.