In my python CS class at school, we were given a true or false question as follows.
A comparison function returns either True or False.
When originally answering I thought about two things. First, a function as follows (what I thought was a comparison function) returns true or false.
def comparison(valOne,valTwo): return valOne<valTwo
Now, I know this isn't a comparison function, but a function with an operator. In addition, I thought of another type of function when answering.
def someoneHasOne(scoreOne,scoreTwo): return scoreOne==15 or scoreTwo==15
From what I know, this is a comparison function.
So, thinking of those two things, I marked this as
However, the correct answer, according to the teacher, was
False. After the answer was marked wrong, I started to do some research. I found this about the operator module that has comparison functions that return
My main question is, am I right (the answer is
True)? Or is my CS teacher right (the answer is