types.CoroutineType

types.CoroutineType The type of coroutine objects, created by async def functions. New in version 3.5.

types.BuiltinMethodType

types.BuiltinMethodType The type of built-in functions like len() or sys.exit(), and methods of built-in classes. (Here, the term “built-in” means “written in C”.)

type

class type(object) class type(name, bases, dict) With one argument, return the type of an object. The return value is a type object and generally the same object as returned by object.__class__. The isinstance() built-in function is recommended for testing the type of an object, because it takes subclasses into account. With three arguments, return a new type object. This is essentially a dynamic form of the class statement. The name string is the class name and becomes the __name__ attribute

TypeError

exception TypeError Raised when an operation or function is applied to an object of inappropriate type. The associated value is a string giving details about the type mismatch.

turtle.ycor()

turtle.ycor() Return the turtle’s y coordinate. >>> turtle.home() >>> turtle.left(60) >>> turtle.forward(100) >>> print(turtle.pos()) (50.00,86.60) >>> print(round(turtle.ycor(), 5)) 86.60254

turtle.xcor()

turtle.xcor() Return the turtle’s x coordinate. >>> turtle.home() >>> turtle.left(50) >>> turtle.forward(100) >>> turtle.pos() (64.28,76.60) >>> print(round(turtle.xcor(), 5)) 64.27876

turtle.write_docstringdict()

turtle.write_docstringdict(filename="turtle_docstringdict") Parameters: filename – a string, used as filename Create and write docstring-dictionary to a Python script with the given filename. This function has to be called explicitly (it is not used by the turtle graphics classes). The docstring dictionary will be written to the Python script filename.py. It is intended to serve as a template for translation of the docstrings into different languages.

turtle.Vec2D

class turtle.Vec2D(x, y) A two-dimensional vector class, used as a helper class for implementing turtle graphics. May be useful for turtle graphics programs too. Derived from tuple, so a vector is a tuple! Provides (for a, b vectors, k number): a + b vector addition a - b vector subtraction a * b inner product k * a and a * k multiplication with scalar abs(a) absolute value of a a.rotate(angle) rotation

turtle.width()

turtle.width(width=None) Parameters: width – a positive number Set the line thickness to width or return it. If resizemode is set to “auto” and turtleshape is a polygon, that polygon is drawn with the same line thickness. If no argument is given, the current pensize is returned. >>> turtle.pensize() 1 >>> turtle.pensize(10) # from here on lines of width 10 are drawn

turtle.write()

turtle.write(arg, move=False, align="left", font=("Arial", 8, "normal")) Parameters: arg – object to be written to the TurtleScreen move – True/False align – one of the strings “left”, “center” or right” font – a triple (fontname, fontsize, fonttype) Write text - the string representation of arg - at the current turtle position according to align (“left”, “center” or right”) and with the given font. If move is true, the pen is moved to the bottom-right corner of the text. By default,