Friday, 22 June 2018

Basic Python Syntax @GHS


Today we had a little play with the programming on Trinkets. When I did this task I copied and pasted the code that was already there and changed the color, possession and angle, Python does not use semicolons. To use loop you have to put number_list = [1,2,3,4,5,6,7,8,9,10] 
tina.color("green") 
tina.speed(50)
for number in number_list: 
   tina.forward(number*10) 
   tina.left(120). 

This maen first I created a list then I put the for loop. tina.forward(number*10) witch means multiply the number list by ten. Any number in the list gets repeated over and over again.

My website link


No comments:

Post a Comment

Thank you for your positive, thoughtful, helpful comment.