Why is function not printing anything to console when called?

Question:

When I call the vote()function, the compiler doesn’t print an output. Why isn’t the function printing anything to the console when I call it?

Here is my code:

def vote(vote_one, vote_two, vote_three):
    if (vote_one == vote_two):
        return True
    elif (vote_one == vote_three):
        return True
    elif (vote_two == vote_three):
        return True
    else:
        return False

vote(1, 2, 1)
Asked By: Darien Springer

||

Answers:

It’s because you aren’t actually outputting anything. When you call vote(), a result is returned (True or False), but you aren’t actually using the result. You could do

result = vote(1, 2, 1)
print(result)

or

print(vote(1, 2, 1))
Answered By: Eric Frechette