Using screen.onclick() in Turtle with a function that returns multiple values
问题 I am trying to use the coordinates from a user's mouse click as the x and y for another function. When that second function runs, it returns two values (not x and y). But when I run the onclick method, I get "TypeError: cannot unpack non-iterable NoneType object" before I even click anything. def on_click(x, y): t = turtle.Turtle() screen = turtle.Screen() t.penup() t.goto(x, y) #do stuff part 1 #do stuff part 2 return value1, value2 def main(): t = turtle.Turtle() screen = turtle.Screen()