You could wrap this in another while
loop or have two separate functions.
while True:
endgame = False
while not endgame:
#game actions
play_again = raw_input("Play again y or n?")
if play_again == 'n':
break
or even separate this into diffrent functions:
def play_again():
play_option = raw_input("Play again y or n?")
if play_option == 'y': game_play()
def game_play():
endgame = False
while not endgame:
#game_actions
play_again()