Tags
python
Asked 2 years ago
5 Aug 2021
Views 247
Darron

Darron posted

Can I use != In Python ?

Can I use != In Python ?
chirag

chirag
answered Aug 8 '21 00:00

yes, you can use != in Python.
not equal work same in Python as in other languages like c or php.

!= is the operation in the Python.
!= is opposite of the ==.

!= return boolean True, if both passed variable's value is not equal.
!= return boolean False, if both passed variable's value is equal.



i=10
j=10
print(i!=j)


it will print boolean False because i and j are not equal.


i=10
j=1
print(i!=j)


it will print boolean True because i and j are not equal.
steave

steave
answered Aug 8 '21 00:00

!= is used to check wheater two variables are not equal or not, it returns true or false based on it.
Post Answer