In this example we will show how to execute code based on the Boolean answer of a function in Python.
Source Code
def my_function():
return True
if my_function():
print('It is True!')
else:
print('It is False!')
Output:
It is True!