Download - Step by step python(week2)
![Page 1: Step by step python(week2)](https://reader035.vdocument.in/reader035/viewer/2022081605/58eebc571a28ab620a8b4649/html5/thumbnails/1.jpg)
Step By Step Python
By- Abhishek JaiswalVia- www.letustweak.comTwitter- @jabhij
![Page 2: Step by step python(week2)](https://reader035.vdocument.in/reader035/viewer/2022081605/58eebc571a28ab620a8b4649/html5/thumbnails/2.jpg)
Week 2
Want a Recap..Of Week1
![Page 3: Step by step python(week2)](https://reader035.vdocument.in/reader035/viewer/2022081605/58eebc571a28ab620a8b4649/html5/thumbnails/3.jpg)
Operators
Precedence
Conditionals
Demos / Quiz
Agenda
![Page 4: Step by step python(week2)](https://reader035.vdocument.in/reader035/viewer/2022081605/58eebc571a28ab620a8b4649/html5/thumbnails/4.jpg)
Operators Arithmetic Relational / Comparison Logical / Boolean Membership Assignment Bitwise
![Page 5: Step by step python(week2)](https://reader035.vdocument.in/reader035/viewer/2022081605/58eebc571a28ab620a8b4649/html5/thumbnails/5.jpg)
Arithmetic OperatorsThe Arithmetic Operators are used to perform the fundamental mathematical operations or some other related operations.
Operator Meaning Structure
+ Addition / Unary Plus (a + b)- Subtraction / Unary minus (a - b)* Multiplication (a * b)% Modulus (a % b)/ Division (a / b)// Floor Division (a // b)** Exponent (a ** b)
![Page 6: Step by step python(week2)](https://reader035.vdocument.in/reader035/viewer/2022081605/58eebc571a28ab620a8b4649/html5/thumbnails/6.jpg)
Explanation Board
![Page 7: Step by step python(week2)](https://reader035.vdocument.in/reader035/viewer/2022081605/58eebc571a28ab620a8b4649/html5/thumbnails/7.jpg)
Explanation Board
![Page 8: Step by step python(week2)](https://reader035.vdocument.in/reader035/viewer/2022081605/58eebc571a28ab620a8b4649/html5/thumbnails/8.jpg)
Relational / Comparison OperatorsThe comparison operators are used to compare the values both side of the operators and performs specific operations based on them.
Operator Meaning Structure
> Greater than (a > b)
< Less than (a < b)
== Equal to (a == b)
!= Not Equal to (a != b)
>= Greater than or Equal to (a >= b)
<= Less than or Equal to (a <= b)
![Page 9: Step by step python(week2)](https://reader035.vdocument.in/reader035/viewer/2022081605/58eebc571a28ab620a8b4649/html5/thumbnails/9.jpg)
Explanation Board
![Page 10: Step by step python(week2)](https://reader035.vdocument.in/reader035/viewer/2022081605/58eebc571a28ab620a8b4649/html5/thumbnails/10.jpg)
Logical / Boolean OperatorsThe Logical Operators are used to perform operations based on Truth Table (Either True or False).
Operator Meaning Structure
and True if both the operands are true (a and b)
or True if either of the operands is true (a or b)not Complements the operand not a
![Page 11: Step by step python(week2)](https://reader035.vdocument.in/reader035/viewer/2022081605/58eebc571a28ab620a8b4649/html5/thumbnails/11.jpg)
Explanation Board
![Page 12: Step by step python(week2)](https://reader035.vdocument.in/reader035/viewer/2022081605/58eebc571a28ab620a8b4649/html5/thumbnails/12.jpg)
Membership Operators
The Membership Operators are used to check whether or not any particular element is in the group (List / Tuple / Dictionary).
Operator Meaning Structure
in Check to see if value is in the sequence
a in [a, b, c]
not in Check to see if value is not in the sequence
a not in [a, b, c]
![Page 13: Step by step python(week2)](https://reader035.vdocument.in/reader035/viewer/2022081605/58eebc571a28ab620a8b4649/html5/thumbnails/13.jpg)
Explanation Board
![Page 14: Step by step python(week2)](https://reader035.vdocument.in/reader035/viewer/2022081605/58eebc571a28ab620a8b4649/html5/thumbnails/14.jpg)
Assignment OperatorsThe Assignment Operators are used for assigning values to any variable while performing a certain operation.Operators Meaning Structure
= Assigns value from ROP to LOP a = b+= Adds ROP to the LOP and assigns result to LOP a = (a + b)
-= Sub ROP to the LOP and assigns result to LOP a = (a - b)
*= Mul ROP to the LOP and assigns result to LOP a = (a * b)
%= It takes mod using two operands and assigns result to LOP
a = (a % b)
/= Div ROP to the LOP and assigns result to LOP a = (a / b)
//= Div(Floor) ROP to the LOP and assigns result to LOP
a = (a // b)
![Page 15: Step by step python(week2)](https://reader035.vdocument.in/reader035/viewer/2022081605/58eebc571a28ab620a8b4649/html5/thumbnails/15.jpg)
Explanation Board
![Page 16: Step by step python(week2)](https://reader035.vdocument.in/reader035/viewer/2022081605/58eebc571a28ab620a8b4649/html5/thumbnails/16.jpg)
Precedence
Any IdeaOperator (Highest to Lowest) Description
() Parenthesis (grouping)f(args...), x[i:i], x[i], x.attr Function call, slicing, subscript, dot** Exponentiation+, -, ~ Unary Positive, Unary Negative, bitwise NOT*, /, % Multiplication, Division, Remainder+, - Addition, Subtraction<<, >> Shifts& Bitwise AND^ Bitwise XOR| Bitwise OR<, <=, >, >=, !=, ==, is, is not, in, not in Comparison, Identity, Membership not Boolean NOTand Boolean ANDor Boolean ORlambda Lambda Expressions
![Page 17: Step by step python(week2)](https://reader035.vdocument.in/reader035/viewer/2022081605/58eebc571a28ab620a8b4649/html5/thumbnails/17.jpg)
ConditionalsIn our day to day life we need to make decisions based on some situations / conditions etc.For example:If it’s not raining, I’ll go to the park.
In programming, the conditional statements are work in the same fashion. They are used to perform certain computations based on whether a condition is True or False.(In python make sure you have written True and False in capital letters.)
![Page 18: Step by step python(week2)](https://reader035.vdocument.in/reader035/viewer/2022081605/58eebc571a28ab620a8b4649/html5/thumbnails/18.jpg)
Structureif expression :
statement (s). . .. . .
else:statement (s). . .
print (‘Outside if’)
(if else Statement)
![Page 19: Step by step python(week2)](https://reader035.vdocument.in/reader035/viewer/2022081605/58eebc571a28ab620a8b4649/html5/thumbnails/19.jpg)
Explanation Board
![Page 20: Step by step python(week2)](https://reader035.vdocument.in/reader035/viewer/2022081605/58eebc571a28ab620a8b4649/html5/thumbnails/20.jpg)
Quick Examples
Let’s have a look --
![Page 21: Step by step python(week2)](https://reader035.vdocument.in/reader035/viewer/2022081605/58eebc571a28ab620a8b4649/html5/thumbnails/21.jpg)
WhatWe Have Learned..Today Operators Precedence Conditionals
![Page 22: Step by step python(week2)](https://reader035.vdocument.in/reader035/viewer/2022081605/58eebc571a28ab620a8b4649/html5/thumbnails/22.jpg)
Q&A
Go, shoot your doubts.
![Page 23: Step by step python(week2)](https://reader035.vdocument.in/reader035/viewer/2022081605/58eebc571a28ab620a8b4649/html5/thumbnails/23.jpg)
About meHe is a Passionate Geek and Student, who loves his hair and glasses more than anything, I guess. Geek | Blogger | Data Science Scholar | TechSavvy | Developer | Painter | Author | Trainer | Tech Evangelist | Philanthropist
Catch me @
Twitter- @jabhij Linkedin- jabhijSkype- jabhijWeb- www.letustweak.com
Tech Networks —
C# CornerCode ProjectMicrosoft ASP.NETLetUsTweakMVC4ALLDZone
![Page 24: Step by step python(week2)](https://reader035.vdocument.in/reader035/viewer/2022081605/58eebc571a28ab620a8b4649/html5/thumbnails/24.jpg)
Quote for the Week
“Be You,
Everyone else is already taken.”
![Page 25: Step by step python(week2)](https://reader035.vdocument.in/reader035/viewer/2022081605/58eebc571a28ab620a8b4649/html5/thumbnails/25.jpg)
Thank You!