Page 428 - ComputerScience_Class_11
P. 428

print("Assignment (=):", c)
                  # Relational Operators
                  print("Equal (==):", a == b)
                  print("Not Equal (!=):", a != b)
                  print("Greater Than (>):", a > b)
                  print("Less Than (<):", a < b)
                  print("Greater Than or Equal (>=):", a >= b)
                  print("Less Than or Equal (<=):", a <= b)





                   Output

                  Addition (+): 13
                  Subtraction (-): 7
                  Multiplication (*): 30
                  Division (/): 3.3333333333333335
                  Modulus (%): 1
                  Exponent (**): 1000
                  Assignment (=): 13
                  Equal (==): False
                  Not Equal (!=): True
                  Greater Than (>): True
                  Less Than (<): False
                  Greater Than or Equal (>=): True

                  Less Than or Equal (<=): False





              12.9.5 Punctuators (Separators)
              In Python, punctuators (or delimiters) are symbols that help organize and structure the code. They do not perform any
              calculations or comparisons like operators do, but they make the program easier to read and understand by separating
              statements, grouping code and showing the proper structure.
              The different types of punctuators in Python are listed below:

                                                 ( )             Used in function calls

                                                 [ ]             Used in lists
                                                 { }             Used in dictionaries
                                                  ,              Separates items

                                                  :              Used in blocks and dictionaries
                                                  .              Access object members








                  426  Touchpad Computer Science (Ver. 3.0)-XI
   423   424   425   426   427   428   429   430   431   432   433