Based on what's been provided, you've not called the function. So you can either call the function and print 2 but variable a will still remain 1 afterwards (method 1) or call the function to update variable a to hold a value of 2 and will remain 2 for future use (method 2):
Method 1:
a = 1
def myCode(a):
a = a + 1
return(a)
print(myCode(a))
Method 2:
a = 1
def myCode(a):
a = a + 1
return(a)
a = myCode(a)
print(a)