Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the position of the turtle?

How can I find the coordinate of a turtle in python?

For example, if the turtle is located at (200, 300), how would I retrieve that position?

like image 962
User9123 Avatar asked Jul 14 '17 08:07

User9123


People also ask

How do you find the direction of a turtle in Python?

right(degrees): Turns the direction that the turtle is facing right (clockwise) by the amount indicated (in degrees). turtle. left(degrees): Turns the direction that the turtle is facing left (counter clockwise) by the amount indicated (in degrees).

How do you get pos in Python?

To find a position of the particular element you can use the index() method of List class with the element passed as an argument. An index() function returns an integer (position) of the first match of the specified element in the List.

What does POS () mean in Python?

Parts of Speech (POS) Tagging. Parts of speech tagging simply refers to assigning parts of speech to individual words in a sentence, which means that, unlike phrase matching, which is performed at the sentence or multi-word level, parts of speech tagging is performed at the token level.


1 Answers

As shown in the Python documentation, turtle.pos() returns the turtle’s current location as a 2D vector of (x,y).

like image 133
Michael Avatar answered Oct 16 '22 11:10

Michael