Operators in python

PRAVESH GREWAL
Python’s Gurus
Published in
Jun 18, 2024
Photo by Tyler Nix on Unsplash

operators are special symbols that perform operations on variables and values. Python includes various types of operators, each serving a different purpose.

#arthmatic operators
a=10
b=20
print(a+b)#addition
print(a-b)#subtraction
print(a*b)#multiplication
print(a/b)#division
print(a%b)#modulus
print(a//b)#floor division
print(a**b)#exponent
#comparison operators
a=10
b=20
print(a==b)#equal to
print(a!=b)#not equal to
print(a>b)#greater than
print(a<b)#less than
print(a>=b)#greater than or equal to
print(a<=b)#less than or equal to
#logical operators
a=True
b=False
print(a and b)#logical and
print(a or b)#logical or
print(not a)#logical not

Python’s Gurus🚀

Thank you for being a part of the Python’s Gurus community!

Before you go:

  • Be sure to clap x50 time and follow the writer ️👏️️
  • Follow us: Newsletter
  • Do you aspire to become a Guru too? Submit your best article or draft to reach our audience.

--

--

PRAVESH GREWAL
Python’s Gurus

Artificial intelligence, Computer-Networking ,Python & Cyber-Security