Making the square using function. Defined one variable named "start". I can put 2 properties which are "length" and "angle" into the variable "start". Code import turtle jenny=turtle.Turtle() def start(length,angle): jenny.forward(length) jenny.left(angle) jenny.forward(length) jenny.left(angle) jenny.forward(length) jenny.left(angle) jenny.forward(length) start(100,90) Example 2: Drawing 4 squa..
One of the simplest things you can do using the turtle module is to draw a line. There are always four steps you need to do in order to use the turtle module: Import the turtle module. If we skip this step, there’ll be no turtle to control. Create a turtle to control. Draw things. Do stuff. This will also automatically create the screen. Run turtle.done(). (NOT bob.done()!) Notice that turtle.do..
- Total
- Today
- Yesterday