Page 179 - Ai_V3.0_c11_flipbook
P. 179

# Logical NOT: Inverts the result, True becomes False and False becomes True
                     logical_not_result = not (x == y)

                     print("Logical NOT Result:", logical_not_result)
                 Output:

                     Logical AND Result: True

                     Logical OR Result: True
                     Logical NOT Result: True



                                 Task                                                   #Coding & Computational Thinking



                     Write Python scripts for the following:
                     1.  Accept a number and display its square and cube.












                     2.  Accept the length and breadth of a rectangle. Display its area and perimeter.













                     3.  Accept principal amount, rate of interest and time period. Calculate and display simple interest.












                     4.  Predict the output:

                         print((7 + 3) - (7 + 3))
                         print(100 + 15 * 2)








                                                                                         Python Programming     177
   174   175   176   177   178   179   180   181   182   183   184