What are Python namespaces all about
This question is asking for namespaces and that is basicially the problem you are having. In lottodraw1 you are only changing the local version of draw1 and thus the global value of draw1 stays unchanged (in your case 0). For that reason you will always use draw1 = None
everywhere else.
My approach would be making an array of the draws and having a general draw function:
draws = []
def draw():
new_draw = random.randint(1,49)
if new_draw not in draws:
draws.append(new_draw)
else:
draw()
draw()
draw()
print(draws)
Now you can just call draw and it will add a newly drawn number that does not exist yet.
As noted by Jean-François Fabre the better version would be using sets, which are faster, but only allow unique values:
draws = set()
def draw():
new_draw = random.randint(1,49)
if new_draw not in draws:
draws.add(new_draw)
else:
draw()
draw()
draw()
print(draws)