Add Parentheses (Exercise)
00:00
Let’s do one more logic exercise just to keep warming up and train your comparator and logical operator muscles. This one here says, “Add parentheses where necessary so that each of the following expressions evaluates to True
.” So again, we want to make sure that each of those three expressions evaluates to True
.
00:19
And we’ve got one that says False == not True
, True and False == True and False
, and not True
and "A" == "B"
, and you’ll have to add parentheses to make sure that they actually evaluate to True
. I’ll try that out in the next lesson in the interactive window, but go ahead and try it out by yourself.
00:40
Think about where you would have to put the parentheses for it to evaluate to True
, and then try it out in the interactive window yourself before looking at the solution in the next lesson.
Become a Member to join the conversation.