I am trying to make a function that has an if/elif statement in it, and I want the if to break a while loop.. The function is for a text adventure game, and is a yes/no question. Here is what i have come up with so far..
def yn(x, f, g):
if (x) == 'y':
print (f)
break
elif (x) == 'n'
print (g)
name = raw_input('What is your name, adventurer? ')
print 'Nice to meet you, '+name+'. Are you ready for your adventure?'
while True:
ready = raw_input('y/n ')
yn(ready, 'Good, let\'s start our adventure!',
'That is a real shame.. Maybe next time')
Now I'm not sure if I am using the function right, but when I try it out, it says I can't have break in the function. So if someone could help me with that problem, and if you could help me if the function and calling the function itself is formatted wrong, that would be very much appreciated.