FAQ: Learn Python - Conditionals & Control Flow - And

This community-built FAQ covers the “And” exercise in Codecademy’s lessons on Python.

FAQs for the Codecademy Python exercise And:

Join the Discussion. We Want to Hear From You!

Have a new question or can answer someone else’s? Reply (reply) to an existing thread!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources about Python in general? Go here!

Want to take the conversation in a totally different direction? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account, billing, Pro, or Pro Intensive? Reach out to our support team!

None of the above? Find out where to ask other questions here!

Other FAQs

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 (search) in the top-right of this page. Still can’t find it? Ask it below by hitting the reply button below this post (reply).

1 Like

I have no idea what to type into the editor for this “And” practice. The Hint doesn’t help out in any way either. I understand math equations and can work out if an equation is true or false, but what am I supposed to type in the editor after each variable? Is this just an exercise in cut, copy, and paste?

Am I supposed to define the ‘bool_one’ variable as:
bool_one = False and False

or am I supposed to make up an equation? I’m clearly not understanding this whole line of exercises.


No, we are supposed to visually/mentally evaluate that expression and supply what we believe the outcome to be.

False and False

will be False since we know that AND short-circuits on false. Only the first operand is evaluated in this case. We are given mental exercises like this so we gain instant recognition of things like that, and are able to do it in our head.

1 Like

I agree with Brave - I had no idea what to do here. And I’m not sure that mtf’s answer is correct… I had to go to “solution” which is just to type exactly what’s in the instructions. I’m not sure how that helps me learn it. But I’m new so who knows. :slight_smile:


I agree with gthill, it’s unclear what is required, I tried what mtf suggested and it didn’t work, so in the end I used the solution button and it was a copy paste situation. Baffling.

For the record, I did not give a solution. We are given expressions to visually examine and evaluate in our heads. Look at it, break it down, first the left operand, then the right (if needs be).

Keep in mind that if the first operand is False then we need not continue evaluating. We’re done. The expression is False. If the first operand is True, then evaluate the second. If it is False then the expression is False, else True.

Do this in your head. That’s the bottom line.


Am I on glue or have I forgotten my basic algebraic functions? The problem presented in bool_4 is
-(1 ** 2) < 2 ** 0 and 10 % 10 <= 20 - 10 * 2
According to my calculations -1 < 1 and 1 >= 0 which renders the answers true and false, making the expression overall false.
I’ve gotten the solution and will move forward in the lesson but I know this is going to bug me… Can someone point out where I’m going wrong?

The goal here is not so much True or False, but truthy or falsy which round out as true or false.

-(1 ** 2)

Order of operations puts brackets first, so we must evaluate what’s inside them, to start.

1 ** 2  =>  1

So now we have -(1). Multiplication is distributive over addition, so we can multiply the contents of the brackets by -1 to arrive at,


Now, 2 ** 0 is 1, so you have first relationship evaluated correctly.

-1 < 1  => truthy

On to the second operand,

10 % 10  =>  0

20 - 10 * 2  =>  20 - 20  =>  0

Note that order of operations put multiplication first, then addition.

Zero is less than or equal to zero, so that expression is also truthy.

truthy and truthy  =>  True

Thank you! I must have misunderstood- % is not the symbol indicating division?

1 Like

It is the symbol for REMAINDER in Euclidean Division.

D = dq + R

where R is the remainder, or modulo of the division, and where q is an integer.

The computer calculates all remainders, so the modulo need not be an integer.

3.14 % 2  =>  1.14

I appreciate your help!

1 Like

I think the main issue people in this thread are having is not related to the maths. I was having the same issue, not quite understanding what the task wanted me to do. I eventually figured out the issue was with capitalisation of the ‘True’ or ‘False’ answers. I had been using lower case words; hence, the software was telling me I was incorrect. Hope this helps anyone else with same issue!

I think the rub is in the counterintuive meaning of % in python as in 10 % 10. This expression returns the reminder of the division of 10 by 10, which is 0.

Yeah, it’s really unclear what we were supposed to do here… i also came here to figure it out.
Tip: make sure True/False are capitalized also, or it will be interpreted as a variable and give an error message

1 Like

How would you print a variable and a string in the same line. What does (5**2) a double asterisk mean?

print (f"What does (5**2) a double asterisk mean? {5**2}. It means 5 squared.")

# What does (5**2) a double asterisk mean? 25. It means 5 squared

Extra reaading


1 Like

Oh. that makes sense. thank you

1 Like

To be honest I never was able to wrap my head around sq roots etc. So I am at a severe disadvantage here.
Looking into operators now. Any help is appricated.

Square root is an operator. Are you looking into operators, or just cherry picking the ones that don’t present with any challenge? Get out of the game if this is the case. We can’t be waffling with operators. They’re the tools with which we thread together the nuts and bolts. Don’t be bailing at this early juncture.

Roots are abstract, since they trace numbers backward to their origins. But this is actually fun stuff that does not take a terrific amount of application to cement the fundamentals in our core thinking. We’re really just augmenting our view of Number.

Roots, exponents, logarithms all speak the same language… Number. It’s just one level up in terms of how they all relate.