Operators in Python
In this blog, we will continue to learn operators in Python Programming.
Why Python Programming?
Because Python is easy to learn. It’s code structure is very simple while other programming languages have complex code structure(i.e, C++, Java, etc). It is the best programming language for a beginner to start to learn how to code. It is widely using in whole over the world. However, It is very demanding language in industry as It is used in Machine Learning, Artificial Intelligence etc.
Types of Operators in Python Programming
Operators are divided into following types in Python:
- Arithmetic operators
- Assignment operators
- Comparison operators
- Logical operators
- Identity operators
- Membership operators
- Bitwise operators
So, We have learn about Arithmetic operators. However For more arithmetic operators, You can check out the official python website. So, Let’s have a look on Assignment operators
Assignment Operators in Python Programming
As we can predict by it’s name. It is used for assign the values to our variables.
- “=” : It is an equal sign
a = 10
print("The given no. is ", a)
OUTPUT:
The given no. is 10
- “+=” : It assigns value with add it’s own value with the integer given to right hand side
a = 10
a+=5
print("The updated variable value is ", a)
OUTPUT:
The updated variable value is 15
Similarly, There are more operators. For example, “*=”, “-=”, “/=” etc.
Comparison Operators In Python Programming
As the name suggest, Comparison operators is used for comparing the values. For example, Equal(==), Not Equal(!=), Greater Than(>), Less Than(<), Greater Than Equal To(>=) etc. These operators always return a boolean value(i.e, 0 or 1).
Boolean values: If the condition is true, It returns True(1). However If The condition is false, It returns False(0).
a = 5
b = 10
c = 15
print(a<b)
print(c>b)
print(b>c)
print(a==c)
OUTPUT:
True
True
False
False
So, We have learned about some more operators, We would continue to learn about rest operators. Also, We will learn more about other types of operators too. So, Be updated on our websites, We will try our best to give a bright path to your career.
However, You can join our whatsapp and telegram groups for daily opportunities links are given below.
Also, Have a look on my previous blogs, In my last blog, I discussed about some arithmetic operators.click here
Recent Job Posts
- Engineering Jobs (BE/Btech/ME/Mtech)
- Motherson (MSSL) Off Campus Drive 2021
- Experienced Jobs (Jobs for experienced professionals)
- Nielsen Off Campus Drive 2021 | Trainee Analyst
- Management Jobs (MBA/BBA etc. jobs)
- Jobs for BA/MA and other graduates
- Prepare for CAT Exam 2021
- Anagha Engineers Digital_Marketing internship
- Mechanical Engineering Internship 2021
- HackerRank Off Campus Drive 2021
- Stellar Infosys Web_Development Internship
- Mechanical Engineering Jobs
[ Important ]
- All Company names, logos, and brands are the Intellectual Property of their respective owners. All company, product, and service names used on this website are for identification purposes only.
- We are not associated with any company/agency/agent whose jobs are posted on mechomotive.com, We are just an information provider for job openings. Read our Disclaimer Policy and Term of Service for more information
For more job offers, CLICK HERE