Computing - Python Commands 04.12.23
04 Dec 2023
Today you are using
Trinket to create a shape design using code.
Example code for a how to build a house
- import turtle
- tina = turtle.Turtle()
- tina.forward(100)
- tina.left(90)
- tina.forward(100)
- tina.right(90)
- tina.forward(10)
- tina.left(135)
- tina.forward(100)
- tina.left(90)
- tina.forward(100)
- tina.left(135)
- tina.forward(10)
- tina.right(90)
- tina.forward(100)
- tina.left(90)
- tina.forward(100)
- tina.left(90)
- tina.forward(60)
- tina.left(90)
- tina.forward(30)
- tina.left(90)
- tina.forward(60)
- tina.right(90)
- tina.forward(70)
- tina.right(90)
- tina.forward(100)
- tina.right(90)
- tina.forward(120)
- tina.up()
- tina.back(100)
- tina.right(90)
- tina.forward(30)
- tina.down()
- tina.forward(30)
- tina.left(90)
- tina.forward(30)
- tina.left(90)
- tina.forward(30)
- tina.left(90)
- tina.forward(30)