Advertisement
michael_xgrind

Turtle

Jan 22nd, 2015
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. #tartaruga
  2. import turtle
  3.  
  4. x = 1
  5.  
  6. for i in range(8):
  7.     if x == 1:
  8.         cor = "red"
  9.     elif x == 2:
  10.         cor = "blue"
  11.     elif x == 3:
  12.         cor = "green"
  13.     elif x == 4:
  14.         cor = "pink"
  15.     else:
  16.         cor = "black"
  17.     turtle.forward(100)
  18.     turtle.right(90)
  19.     turtle.color(cor)
  20.    
  21.     if i < 4:
  22.         x += 1
  23.     elif i == 4:
  24.         x = 1
  25.     else:
  26.         x += 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement