Re: [Tutor] calling function

2017-11-27 Thread Alan Gauld via Tutor
On 27/11/17 20:47, Howard Lawrence wrote: > import turtle > # this part draws a square > def square(): > > my_turtle = turtle.Turtle() Note that this creates my_turtle as a local variable inside the function. It will not be visible outside the function. > my_turtle.forward(100) > my_

[Tutor] calling function

2017-11-27 Thread Howard Lawrence
import turtle # this part draws a square def square(): my_turtle = turtle.Turtle() my_turtle.forward(100) my_turtle.left(90) my_turtle.forward(100) my_turtle.left(90) my_turtle.forward(100) my_turtle.left(90) my_turtle.forward(100) square() my_turtle.forward(100)