Press [<] and [>] to cycle the Scratch blocks. Press [SPACE] to view the block's Python equivalent. Press [SPACE] again to go back.
This is an #intro to #Python for #beginners who know #Scratch. NOTE: In python, #imports go at the beginning of the whole program. Also to use the #turtle #module, you have to use this #script to set it up: import turtle t = turtle.Turtle() wn = turtle.Screen() if __name__ == "__main__" [add your turtle instructions here] something fun for turtle: import turtle t = turtle.Turtle() t.shape("turtle") wn = turtle.Screen() wn.setup(width=600, height=600) def forward(ln): t.forward(ln) def backward(ln): t.backward(ln) def left(ln): t.left(ln) def right(ln): t.right(ln) def shape(): forward(45) left(90) forward(45) right(90) forward(10) right(90) forward(45) left(90) forward(45) left(90) forward(150) left(90) forward(100) left(90) forward(150) backward(130) left(90) forward(70) right(90) forward(40) right(90) forward(70) shape()