Skip to main content

Python Identity Operators

 

Python Identity Operators.





Operators

Description

Example

Is

Returns True If Both Same

A Is B

Is Not

Return True If Both Are Not Same

A Is Not B

Ex.

X = 22

Y = 25

print(X is Y)

print(X == Y)

print(X is not Y)

print(X != Y)


OUTPUT

False
False
True
True



Comments

Popular posts from this blog

Python Username and Password using if .. else

 Easy ways to check username and password by using simple if else statement. Ex. username = "saransh" password = "Saransh77" x = input("enter your username- ") y = input("enter your password- ") if x == username: if y == password: print("Okay Right..!") else: print("please enter correct username or password.") OUTPUT

Reverse String In Python By Simple Methods

  x = "Code By Saransh" y = x[::-1] print(y) OUTPUT hsnaraS yB edoC

HOW TO MAKE BLOG WEBSITE

 HOW TO MAKE BLOG 👊👊 STEP 1 - OPEN GOOGLE CHROME  STEP 2 - TYPE  - BLOGGER -> CLICK  CREATE NEW BLOG STEP 3  - SELECT GMAIL ACCOUNT STEP 4 - NAME YOUR BLOG -> WEBSITE NAME