Python Day 35 – you can not a boolean??

Today my Udemy course went more in depth with “and” and “or” inside if statements. I learned that one can use greater than (>) or less than (<) signs to determine whether a line prints, and that you can combine multiple of these together.

I also learned that you can put “not” in front of a boolean and it’ll treat the boolean as the opposite of what it actually is! For instance:

raining = False

if not raining:
print(“it’s not raining”)
print(“it’s raining”)

Neat stuff!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: