Robert Femi689 Points
This one should be short and sweet. Challenge Task 1 of 1
Why isn't the code accepted if I put ("True") and ("False") but it's accepted if remove brackets and quotation marks? Spent a LONG time figuring that out and would like to learn why so at least it won't be a complete waste of time. Would appreciate if someone can explain that to me. Many thanks.
def even_odd(number): if number % 2 == 0: return ("True") else: return ("False")
Alex KoumparosPython Web Development Techdegree Student 35,918 Points
Strictly, the problem is just with the quotation marks, not with the parens.
will pass but
This is because
"True" are completely different data types.
True is a boolean (a data type that can only ever be
False, and Python can understand semantically what true and false mean) and
"True" is a string (and Python doesn't generally have any way to understand what is semantically in a string, just that it is a sequence of characters).
As for the parentheses, they are completely redundant and should be removed.