You have two main options, make a main loop for your program instead of calling the same function, or you can pass arguments. It looks like you're new to programming, so I will explain them a bit for you:
While loops are basically blocks of code that will repeat over and over, until a certain condition is finished. They look like this:
exit = False
while exit != True:
print "Hello!"
exit = True
This loop in specific will only run once, since we set exit to True in the first iteration. However, if we took that line away, it would run forever until the program explodes or we close it out manually.
So one solution could be something like this:
def ATM():
exit = False
while exit != True:
normal logic you are doing
if op = 'N':
exit = True
sys.exit()
Another solution would be to pass an argument to ATM(). Passing arguments is basically a way to set up a variable for a function before it runs, which gives you the power to set things in outside functions. For instance:
def foo():
my_var = "test"
bar("test")
def bar(another_var)
print another_var
This will print "test", even though the variable was defined in a function separate from the function which calls print. We're essentially passing our my_var variable to the bar() function, which sets it up for use for us. So you can do something like:
my_var = 123
def ATM(some_var):
do stuff
if exit == False:
ATM(some_var)
else:
sys.exit()
Play with it first and let me know if you have any questions after.