from tkinter import*
root = TK()
c = Canvas(root, width = 200, height = 200, bg="white")
c.pack()
ball = c.create_oval(0, 100, 40, 140, fill="green")
def motion():
c.move(ball, 1, 0)
if c.coords(ball)[2] < 300:
pass
motion()
root.mainloop()
if c.coords(ball)[2] < 300:
<code>