We use these operators to evaluate a statement to return either a True or a False
Operator | Syntax | Description | Example |
---|---|---|---|
and | x and y | This returns True if both x and y are true |
x = 10 |
or | x or y | This returns True if either x or y are true | x = 10 x > 5 or x < 2 |
not | not x | Reverses a result, so if something is True , not turns it False |
x = 10 not(x > 5 and x < 15) |
Example
You are expected to comply with University policies and guidelines namely, Appropriate Use of Information Resources Policy, IT Usage Policy and Social Media Policy. Users will be personally liable for any infringement of Copyright and Licensing laws. Unless otherwise stated, all guide content is licensed by CC BY-NC 4.0.