Is there a command for getting out of the function?
I just started with python. I tried to write a small code for guessing a number. I wondered if we can get out of the function only, not the whole program.
Code:
def user_guess(num):
if(num==rand_num):
print "hurrey! you guessed it right.\n"
another_try=raw_input("would you like to guess another number??\n")
if(another_try == "y" or another_try == "yes"):
Leave a comment: