0

For a project I need to use the goto command alot and for something like trees I only want the turtle to goto to between certain coords for example I only want it to draw a tree within (300,0) and (500,100)

1
  • Please share your code as a minimal reproducible example and share your attempt at solving this. What is your specific question?
    – ggorlen
    Commented Sep 15, 2022 at 15:20

1 Answer 1

0

If you want to go to random positions between (300, 0) (500,100), you can use randrange for the coordinates. Here is a simple tutorial: https://www.geeksforgeeks.org/randrange-in-python/

If you meant you were trying to give parameters as value you can use this:

x = 100
y = 250

goto(x,y)

I hope that this is what you meant.

Not the answer you're looking for? Browse other questions tagged or ask your own question.