I am trying to write program with turtle python that ask the user for a number and let him click on the screen the same number of times.
import turtle
t = turtle.Turtle()
count = 0
def up_count(x,y):
global count
count = count + 1
print count
return
def start():
num1=int(raw_input("enter number"))
print "in the gaeme you need to enter number and click on button",num1,"times"
s = t.getscreen()
if not num1 == count:
s.onclick(up_count)
else:
t.mainloop()
start()
The problem is that I can not get out of mainloop when num1 == count.
How can I get out of mainloop?
I use https://repl.it/@eliadchoen/BrightShinyKernel for the program.