Advertisement
Arcot

ch4 ex2

Oct 20th, 2022 (edited)
908
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. import random
  2. from turtle import *
  3.  
  4. t=Turtle()
  5.  
  6. distance=0
  7. while distance<5000:
  8.   #random value for length
  9.   a=random.randrange(40)
  10.   #random value for angle
  11.   b=random.randrange(360)
  12.  
  13.   t.forward(a)
  14.   t.right(b)
  15.   distance += a
  16.  
  17. done()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement