def func_one(a):
message = ""
if a >= 18:
message += 'You may apply to join the military.'
if a >= 35: # independent from a >= 18
message += ' You may run for president.'
return message
def func_two(a):
message = ""
if a >= 18:
message += 'You may apply to join the military.'
elif a >= 35: # only runs when a >= 18 is False
message += ' You may run for president.'
return message
def main():
print(func_one(40))
print(func_two(40))
main()
You may apply to join the military. You may run for president.
You may apply to join the military.