Datatype | Mutability |
---|---|
list | Mutable |
tuple | Immutable |
dict | Mutable |
class | Mutable |
print(n)An instance method is called from an object, for example,
# The instance variable upper is called from the object s. u = s.upper( )
n = int( ) s = str( ) p = Person("Alice", "F", 11)
__init__ __str__
import turtleat the top of your script
s = turtle.Screen( )
t = turtle.Turtle( )
Instance Method | Parameter | Action |
---|---|---|
backward | distance (int) | Move turtle backward |
color | color_name (str) | Change color of turtle pen |
forward | distance (str) | Move turtle forward |
heading | Return heading angle | |
left | angle (int) | Turn turtle heading to left |
pendown | Put turtle pen down to write | |
penup | Put turtle pen up to not write | |
position | Return turtle position (x, y) | |
right | angle (int) | Turn turtle heading to right |