Booleans and Conditionals - What Are Truthy and Falsy Values, and How Do Boolean Operators and Short-Circuiting Work?

Tell us what’s happening:

is_admin = False

if not is_admin:
print(‘Access denied for non-administrators.’) # Access denied for non-administrators.
else:
print(‘Welcome, Administrator!’)

With this code “is_admin” is set to “False”
NOT is_admin means the person “is the admin” or boolan is TRUE
The more appropriate print statement would be: print(‘Welcome, Administrator!’) being this shows is_admin is true

Am I reading too much into this?

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36

Challenge Information:

Booleans and Conditionals - What Are Truthy and Falsy Values, and How Do Boolean Operators and Short-Circuiting Work?

GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/lecture-booleans-and-conditionals/68480f431e8568b2056b140b.md at main · freeCodeCamp/freeCodeCamp · GitHub

Hi @aleiaelle,

I get that this is a bit confusing at first, but “if not is_admin” is saying “if is_admin is not True” (meaning if it’s False), which evaluates to True, which is why the “Access denied…” message is printed.

Happy coding!