Python arithmetic operators

Python3 arithmetic operators

This lecture will covers arithmetic operators!



There are two main number types we will work with in this session 
-	Integers which are whole numbers.
-	Floating Point numbers which are numbers with a decimal.

Let’s explore with basic math with Python
We will also discuss how to create variables and assign them values.  

python course
Using complier pleae test the following arithmetic operators hands-on excercise for you 

2+1
3

2-1
1

2*2
4

3/2
1.5

Modulo or Mod operator
7 / 4 
1.75

7 % 4
3

50 % 5
0

23 % 2 
1

20 % 2 
0

2 ** 3  // to the power of 3
8


practicle 

2 + 10 * 10 + 3
105

(2 + 10) * (10 + 3)
156

X = 10 + 3 * 2
print(x)

Order of operator precedence 

exponentiation 2**3
multiplication or division 
addition or subtraction 

exponentiation 10 + 3 * 2  ** 2 
ans is 22
2**2 =4
3*4 = 12
10+12 =22

Parenthesis using always given priority 
X = (2 + 3) * 10 – 3
Print(x)
(2+3) = 5
5 * 10 = 50 -3

Output: 
47
  
Python data science interview questions and answers python is a high-level programming language using Data Science programs these days

Data Science

Harisystems is optimized for learning, testing and training. courses are designed to be simplified to improve reading and basic understanding for beginners to expert level. Tutorials and examples are constantly reviewed to avoid errors, however we cannot warrant full correctness of all content. if any found need to correct write us at info@harisystems.com. we Harisystems is not responsible for any with this tutorials, While using this site, you agree to have read and accepted our terms of use, cookie and privacy policy. Copyright 2007-2020 by Harisystems. All Rights Reserved.
Copyright © Harisystems 2020