def function(a):
if a == '1':
print ('1a')
else if a == '2'
print ('2a')
else print ('3a')
Should be corrected to:
def function(a):
if a == '1':
print('1a')
elif a == '2':
print('2a')
else:
print('3a')
As you can see, else if should be changed to elif, there should be colons after '2' and else, there should be a new line after the else statement, and close the space between print and the parentheses.