from random import randint
def roll_the_dice():
dice = randint(1, 6)
dice2 = randint(1, 6)
print dice , dice2
x = raw_input('If you want to reroll press 1 if not press 2:\n')
if x == int(1):
continue
elif x == int(2):
break
else:
print 'Invalid input'
roll_the_dice()
The problem is where i put the continue , how do i make it restart depend on the answer