turtle.up() method in Python
Last Updated :
16 Jul, 2020
The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses Tkinter for the underlying graphics, it needs a version of Python installed with Tk support.
turtle.up()
The turtle.up() method is used to pull the pen up from the screen. It gives no drawing on moving to another position or direction.
turtle.up() or turtle.pu() or turtle.penup()
Here, this method can be called with three names as written above i.e; it has Aliases: penup | pu | up. There is no argument required for this method.
Below is the implementation of the above method with some examples :
Example 1 :
Python3
import turtle
turtle.forward( 50 )
turtle.up()
turtle.forward( 50 )
turtle.down()
turtle.forward( 50 )
|
Output:
Example 2 :
Python3
import turtle
turtle.forward( 50 )
turtle.right( 90 )
turtle.up()
turtle.forward( 50 )
turtle.down()
turtle.right( 90 )
turtle.forward( 50 )
|
Output: