turtle.undobufferentries() function in Python
Last Updated :
26 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.undobufferentries()
This function is used to return the count of entries in the undobuffer. It doesn’t require any argument.
Syntax :
turtle.undobufferentries()
Below is the implementation of the above method with some examples :
Example 1 :
Python3
import turtle
for i in range ( 50 ):
turtle.forward( 20 + 2 * i)
turtle.right( 90 )
print (turtle.undobufferentries())
|
Output :
100
Example 2 :
Python3
import turtle
for i in range ( 50 ):
turtle.forward( 20 + 2 * i)
turtle.right( 90 )
while turtle.undobufferentries():
turtle.undo()
|
Output :
Share your thoughts in the comments
Please Login to comment...