Jul-10-2019, 03:41 PM
This book I'm working out of talks about making a boolean function. It works good and here is the code:
And when I look at the is_even if statement structure there is no mention of status there either.
So I don't understand where status is going and how it's being checked in the if statement.
def is_even(number):
if(number % 2 == 0):
status = True
else:
status = False
return status
number = int(input("Enter a number: "))
is_even(number)
if is_even(number):
print("The number is even")
else:
print("The number is odd")What I don't understand is at the bottom of the function the line that reads return status. Where is status going? There is no variable that status is being assigned to.And when I look at the is_even if statement structure there is no mention of status there either.
So I don't understand where status is going and how it's being checked in the if statement.
