In this Video I am going to show How to Use Basic Math, Mathematical Operators and Python Expressions In python.
So what is an expression ? An expression is A data value or set of operations to compute a value.
Arithmetic operators we will use:
+ – * / addition, subtraction/negation, multiplication, division
% modulus, a.k.a. remainder
** exponentiation
precedence: Order in which operations are computed.
Mathematical Operators
Here are some commonly used mathematical operators
Syntax Math Operation Name
a+b {displaystyle a+b,} a+b, addition
a-b {displaystyle a-b,} a-b, subtraction
a*b {displaystyle atimes b,} atimes b, multiplication
a/b {displaystyle adiv b,} adiv b, division (see note below)
a//b {displaystyle lfloor adiv b,rfloor } lfloor adiv b,rfloor floor division (e.g. 5//2=2) – Available in Python 2.2 and later
a%b {displaystyle a~{bmod {~}}b,} a~{bmod ~}b, modulo
-a {displaystyle -a,} -a, negation
abs(a) {displaystyle |a|,} |a|, absolute value
a**b {displaystyle a^{b},} a^{b}, exponent
Order of Operations (Python Operator Precedence)
Highest precedence at top, lowest at bottom.Operators in the same box evaluate left to right..
Name Syntax PEMDAS Mnemonic
Parentheses ( … ) Please
Exponents ** Excuse
and Division * , / , // , % My Dear
and Subtraction + , – Aunt Sally
#PythonTutorialforBeginners #ProgrammingKnowledge #LearnPython #PythonCourse
——————-Online Courses to learn—————————-
Blockchain Course –
Big Data Hadoop Course –
Java –
C++ –
AngularJS –
Python –
Android –
Linux –
AWS Certified Solutions Architect –
Modern React with Redux –
My Website –
My Blog –
My Facebook Page –
Google+ –
Twitter –
Pinterest –
Text Case Converter –
————————-Stuff I use to make videos ——————-
Stuff I use to make videos
Windows notebook –
Apple MacBook Pro –
Ubuntu notebook –
Desktop –
Microphone –
notebook mouse –
——————Facebook Links —————————————-