Advertisement
timber101

Turtle_Basics_Part_5-Location

Mar 20th, 2022
1,378
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None
  1. # turtle library
  2. import turtle
  3.  
  4. #This to make turtle object
  5. tess=turtle.Turtle()
  6.  
  7. # self defined function to print coordinate
  8. def buttonclick(x,y):
  9.     print("You clicked at this coordinate({0},{1})".format(x,y))
  10.  
  11.  #onscreen function to send coordinate
  12. turtle.onscreenclick(buttonclick,1)
  13. turtle.listen()  # listen to incoming connections
  14. turtle.speed(10) # set the speed
  15. turtle.done()    # hold the screen
Advertisement
RAW Paste Data Copied
Advertisement