[Type A] Python Revision Tour-1 – Chapter 1

|
Table of Contents

8. What are operators? What is their function? Give examples of some unary and binary operators.

Operators in Python are symbols or keywords that perform operations on operands. They can be unary (operating on a single operand) or binary (operating on two operands).

Some examples of unary operators:

  • -: Negation
  • not: Logical NOT

Some examples of binary operators:

  • +: Addition
  • -: Subtraction
  • *: Multiplication
"Spread the light within, illuminate the hearts around you. Sharing is not just an action, but a sacred journey of connecting souls."~ Anonymous

Leave a Reply

Your email address will not be published. Required fields are marked *