chevron_left
933 points
8 4 2

!= in python

posted Oct 11 1 min read

Problem:

Hello guys,
I am really very new to python language and wanted to learn this new stuff basically I come from the c language background and I am totally new to python and yes some of the c language concept of the is really helping I want to know about the realtional operator in python is it the same way as it was define in the c language or it is some different type in implementation of it.

Solution:

I have got your problem you wanted to learn the relational operator in the python I would say the internal structure of the relational operation is same in both operation python and c language.
Relational operators are the symbol that performs the task with the given value and give the result as True or False depending upon the condition. There are a bunch of relational operator in python that is less than, greater than, equals and not equals to but in specific we are going to see the != (Not equals to).

age = 16
if(age != 18):
       print('Your account has been created!')
else:
       print('Sorry, please come back later')

Output: As the 16 and 18 are not equal so the account would be created as per the condition.

Your account has been created!

I hope this is going to help you. Happy coding!!

More Posts

What does invalid syntax mean in python? Naymul01 - Oct 19
How to print space in python ? Naymul01 - Oct 19
How to set a timer in python ? Naymul01 - Oct 19
Check if character in string python Naymul01 - Oct 19
How to get the first character of a string in python? Naymul01 - Oct 19
What is a keyerror in python? Naymul01 - Oct 19
How to get last character of string in python? Naymul01 - Oct 19
In python, math expressions are evaluated from left to right, no matter what the operators are. Naymul01 - Oct 19
Python append to string in loop Naymul01 - Oct 19
How to make an empty set in python ? Naymul01 - Oct 17