CPSC 231 Chapter 4: Summary - Python Turtle Graphics

61 views3 pages

Document Summary

First you import the module turtle so you can use its types. From the module, you can get screen and turtle . Turtle. screen(), turtle. turtle() [assign these two into variables in order to work further with them] When a turtle is created, it faces east. Variable = things that you put inside, separated by comma have their sequence. The program will check every value inside until they are put into the loop body. For x in [1, 2, a , b ]: Trt. forwards(50) the turtle will move until it puts every value inside the loop, so it will move that many times (4) If you name the values as numbers or colors, you can use them within the loop and it will do that (i. e. [1,2] for size, [yellow, purple] for color and such. But in order to color it, you need to add it to trt. color(color variable).

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Questions