turtle.isdown() function in Python
Last Updated :
20 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.isdown()
This method is used to check whether the turtle is down or not. It doesn’t require any argument and return a boolean value as True if the pen is down, False if it’s up.
Syntax :
turtle.isdown()
Below is the implementation of the above method :
Python3
import turtle
print (turtle.isdown())
turtle.forward( 10 )
turtle.up()
print (turtle.isdown())
turtle.down()
turtle.forward( 10 )
print (turtle.isdown())
|
Output :
True
False
True
Share your thoughts in the comments
Please Login to comment...