To see the basic operators in python3.
+ , - , * , / , % , ** , //
Used to perform basic arithmetic like addition, subtraction, multiplication, division.Comparison operator.
== , != , > , < , <= , >=
These operators compare the values on either side of them and decide the relation among them.
These are also called as relational operators.
= , += , -= , *= , /= , %=, //=
These operators used to assigns values from right side operands to left side operand.
and Logical AND, or Logical OR, not Logical NOT.
If both the operands are true then condition becomes true.
in , not in
Python membership operators test for membership in a sequence, such as strings, lists, or tuples.
#get input from user
num=int(input(“enter the number:”))
#using conditional operator
if num > 1:
#using membership operator
for i in range(2,num):
#using arithmetic and assignment operator
if (num % i== 0):
print(num,”is not a prime number”)
#using arithmetic operator
print(num,”is a prime number”)