Predict the output of the following code snippet:
ptr=50
def result():
global ptr
ptr=ptr+1
print ptr result()
print ptr
The output is
51