conditions (Programming, Logic and choice) – Mathplanet

PHOTO EMBED

Fri Mar 29 2024 20:01:25 GMT+0000 (Coordinated Universal Time)

Saved by @wiseteacher

Opposites
The last important keyword is not.

if not (ram < 8):
    print("Enough memory")
Copy code

Copy And Save

Share

Ask Copilot

 Save
This is equivalent to writing:

if ram >= 8:
    print("Enouph memory")
Copy code

Copy And Save

Share

Ask Copilot

 Save
Notice that it's >= now. Why? (What happens if the variable ram is exactly 8?)

All of this is the field of logic!
content_copyCOPY

https://www.mathplanet.com/education/programming/logic-and-choice/logical-conditions