Page 304 - Artificial Intellegence_v2.0_Class_9
P. 304
a = 5
Returns True if the first value is
Greater than or >= greater than or equals to the b = 10
equal to
second value otherwise False. False
a >= b
a = 5
Returns True if the first value is less
Less than or <= than or equals to the second value b = 10
equal to
otherwise False. True
a <= b
Brainy Fact
Python uses ASCII/Unicode character set. ASCII Stands for "American Standard Code for
Information Interchange." It is a character encoding standard that uses numerical codes to
represent characters in uppercase and lowercase, numbers and punctuation symbols. ASCII
values of capital letters A–Z are 65 to 90, small letters are 97 to 122 and numbers 0 to 9 are 48
to 57.
Logical Operators
Logical operators are used to combine one or more conditional statements and returns either True or False
based on the evaluation of the conditions. Following logical operators are provided by Python:
Name Symbol Purpose Example Output
Returns True if both the operands
AND and 5 < 10 and 2 < 5 True
are True otherwise False.
Returns True if either the operands
OR or 5 > 10 or 2 < 5 True
is True otherwise False.
not(5 > 10 or 2 < 5) False
Returns True if the operand is False.
NOT not not(10 < 5) True
It reverses the result.
not(True) False
Brainy Fact
In case of OR operator, the second condition is checked only if the first is False otherwise it ignores
the second operand.
Assignment Operator
Assignment operator is used to assign a value to a variable or a constant. = sign is used as an assignment
operator in Python. For example,
rollno = 12
myname = "Alisha"
mymarks = 92.5
302 Touchpad Artificial Intelligence (Ver. 2.0)-IX

