You could do something like this:
Assign a bool value to a variable called playing, and then use that as the loop condition.
So you would have;
playing = True
while playing:
choice = input("would you like to play again? y/n: ")
if choice == "n":
print "Thanks for playing"
playing = False
else:
print "play again.. etc..."
Setting the playing variable to false with cause the loop to terminate.