The following are links to additional questions that our community has asked about this exercise:
This list will contain other frequently asked questions that aren’t quite as popular as the ones above.
Currently there have not been enough questions asked and answered about this exercise to populate this FAQ section.
This FAQ is built and maintained by you, the Codecademy community – help yourself and other learners like you by contributing!
Not seeing your question? It may still have been asked before – try () in the top-right of this page. Still can’t find it? Ask it below by hitting the reply button below this post ().
when I am instructed to set bool_two to the result of true or false and bool_four to the result of true or true, is the program implying that I write a equations utilizing proper boolean operators, or that I simply demonstrate my understanding if how “or” works by setting each bool to true?
Hi guys, I’m trying to understand one thing. In conditionals and control, in the “or” exercises, you have to determine if the result is False or True.
This one : 2 ** 3 == 108 % 100 or ‘Cleese’ == ‘King Arthur’
is supposed to be True…why? I don’t understand. Both sides are for me False and thus the result should be False…or why is one of those sides True?
Thanks in advance
OR expressions only require one operand to evaluate to True for the expression to yield as True. In the above, the second operand is not even evaluated since the first operand is True.
In Python, remainder division can be performed on floats or integers, so writing,
3.14 % 2
will result in 1.14, the remainder.
When we write with integers only,
314 % 200
the result is 114.
In all instances of modulo division, the quotient is an integer. If the divisor and or dividend are floats, the modulo will be a float.
Think of when we first learned long division with paper and pencil. We were never told that the remainder had another name (modulo) only that it was the remaining portion of the dividend that was smaller than the divisor. The modulo is always smaller than the divisor.
So glad you asked this! I now realise it was my misunderstanding that the modulo and not the quotient was shown rather than my lack of Monty Python knowledge gave me the wrong ansewr
I’m sorry I don’t think I understand. Do you mean we should be inputting expressions that equal to the true and false statements? I’m very confused about what bool_two is asking for in general. If I try to get bool_two to return two different bools I’m unsure how as a or bool should only give us one true or false
Rather than copying and pasting, you should evaluate the expression yourself and then enter the answer, either True or False into the editor. That’ll teach you how o think about and evaluate expressions.