GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing www.dremendo.com — Arithmetic Operators in Python Programming | Dremendo
?>
Announcements
No new announcements.
Python Programming Tutorial
Table of Contents
Arithmetic Operators in Python ProgrammingIn this lesson, we are going to look at what is arithmetic operators and will learn the different types of arithmetic operator with the help of examples. What is Arithmetic OperatorsArithmetic Operators in Python are used to performing arithmetic or mathematical operations on operands.
Video Explanation
Click the button below to watch the explanation.
Please wait while the video is loading....
There are 7 types of arithmetic operators:
Addition Operator +The Addition Operator + is used for adding the value of two or more variables.
Example
In the example above, the value of x and y is first added and then stored in z. So the result of z is 7. Subtraction Operator -The Subtraction Operator - is used for subtracting the value of two or more variables.
Example
In the example above, the value of y is subtracted from x and the final result is stored in z. So the result of z is 3. Multiplication Operator *The Multiplication Operator * is used for multiplying the value of two or more variables.
Example
In the example above, the value of x and y is first multiplied and then stored in z. So the result of z is 10. Division Operator /The Division Operator / is used for dividing the value of two or more variables and the quotient is returned as the result of the division. Let's see the example for more understanding.
Example
In the example above, the value of x and y is first divided and then stored the quotient in z. So the result of z is 2.5. Modulus Operator %The Modulus Operator % is used for dividing the value of two or more variables and the remainder is returned as the result of the division.
Example
In the example above, the value of x and y is first divided and then stored the remainder in z. So the result of z is 1. Exponentiation Operator **The Exponentiation Operator ** is used to multiply a number till a certain number of times. In mathematics it is written as xn where x is the base number and n is the power, So x will be multiplied n times.
Example
In the example above, the value of x is multiplied two times (value of y) and then stored in z. So the result of z is 25. Floor Division Operator //The Floor Division Operator // is used to round off the result of the division down to the nearest whole number. In other words, the decimal portion is removed from the result after division.
Example
In the example above, the value of x and y is first divided and then the decimal portion is removed from the quotient and after that the value is stored in z. So the result of z is 6. Test Your KnowledgeAttempt the questions in the exercise to check whether you have understood the lesson clearly.
We care about your privacyDremendo uses cookies and similar technologies that are necessary for the site to work properly, understand how you interact with our website, and measure the effectiveness of our marketing. By clicking Accept All, you consent to the use of non-essential cookies and similar technologies for analytics, advertising, and ad measurement, as described in our Privacy Policy. Cookie PreferencesChoose which types of cookies Dremendo may use.
Necessary Cookies
Allow
Required for essential website functionality and security.
Analytics Cookies
Allow
Help us understand how visitors use Dremendo.
Marketing Cookies
Allow
Help us measure advertising performance and understand interactions with our advertisements.
Mentora
Question Asked: 0 / 20
Hi, I’m Mentora! I’m your personal AI tutor from Dremendo. Ask me anything, and I’ll help you understand it in a simple and easy way. |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |