And SyntaxError: invalid syntax


#1




File "python", line 5
bool_three = 19 % 4 != 300 / 10 / 10 and False
^
SyntaxError: invalid syntax


good job?


bool_three = 19 % 4 != 300 / 10 / 10 and False


#2

It is a shame this exercise isn't validated properly, a lot of people miss the point of this exercise because of poor validation (codecademy's fault).

what you should do, is validate the condition, and then set bool to true or false

lets do bool_one as example, the condition provided by the exercise is:

False and False

if this condition would evaluate to True, set bool_one to true:

bool_one = True

If this condition would evaluate to False , set bool_one to false:

bool_one = False

now do this for all.

By doing the exercise this way, you should get a good understanding of the and operator


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.