Page 195 - AI Ver 1.0 Class 10
P. 195

Brainy Fact

                       ASCII  Stands for "American  Standard  Code for Information Interchange." It is a character encoding
                       standard that uses numeric codes to represent characters in upper and lower case, numbers, and
                       punctuation symbols.

                       ASCII value of capital letters A–Z is 65 to 90, small letters is 97 to 122 and numbers 0 to 9 is 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. Logical operators used in Python are given below:

                   Name       Symbol               Purpose                          Example                  Output

                 AND        and          Returns True if both the  Num1=14
                                         operands are true.             Num2=10
                                                                        Num1<Num2 and Num1>20             False
                 OR         or           Returns True if either the  Num1=14
                                         operands is true.              Num2=10
                                                                        Num1>Num2 or Num1<Num2            True

                 NOT        not          Returns True if the operand is  not(5>10 or 2<5)                 False
                                         False. It reverses the result.  not(5<10)                        True
                                                                        not(False)                        True




                                 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. The '=' sign is used as an assignment
                 operator in Python. For example:










                 Augmented Assignment Operators
                 Augmented assignment operators are those operators which take the value of the operand on the right side,
                 perform an operation and assign a new value to the operand on the left side. For example, if Sum=0, then
                 Sum+=10 is the same as Sum=Sum+10.


                                                                                           Advance Python   193
   190   191   192   193   194   195   196   197   198   199   200