Professional Documents
Culture Documents
Python Programming - An Industry Perspective: Dr. Mani Madhukar Ishan Vaid
Python Programming - An Industry Perspective: Dr. Mani Madhukar Ishan Vaid
- An Industry Perspective
Dr. Mani Madhukar
Ishan Vaid
Variable
Data Types
1.Numbers
2.String
3.List
4.Tuple
5.Dictionary
6.Boolean
Python Operators
Arithmetic Operators
➢ + Addition x + y
➢ – Subtraction x – y
➢ * Multiplication x * y
➢ / Division y / x
➢ % Modulus y % x
➢ ** Exponent Exponentiation x**b
➢ // Floor Division – Integer division rounded toward minus
infinity
Relational Operators
➢ == The condition becomes True, if the values of two operands are equal.
➢ != The condition becomes True, if the values of two operands are not equal.
➢ <> The condition becomes True, if values of two operands are not equal.(x<>y)
is true. This is similar to != operator.
➢ > The condition becomes True, if the value of left operand is greater than the
value of right operand.(x>y) is not true .
➢ < The condition becomes True, if the value of left operand is less than the value
of right operand.(x<y) is true.
➢ >= The condition becomes True, if the value of left operand is greater than or
equal to the value of right operand.
➢ <= The condition becomes True, if the value of left operand is less than or equal
to the value of right operand.
Logical Operators
➢ and Logical AND: True if both the operands are true x and y
➢ or Logical OR: True if either of the operands is true x or y
➢ not Logical NOT: True if operand is false not x
Bitwise operators
➢= x=y+z
➢ ^= ^=b a=a^b
➢ += a+=b a=a+b
➢ >>= a>>=b a=a>>b
➢ -= a-=b a=a-b
➢ <<= a <<= b a= a << b
➢ *= a*=b a=a*b
➢ /= a/=b a=a/b
➢ %= a%=b a=a%b
➢ //= a//=b a=a//b
➢ **= a**=b a=a**b
➢ &= a&=b a=a&b
➢ |= a|=b a=a|b
Identity operators
Membership operators
➢ int()
➢ float()
➢ str()
➢ tuple()
➢ set()
➢ list()
Conditional statement
➢ if
➢ if….else
➢ elif
➢ Nested if
Looping
➢ break statement
➢ continue statement
Manipulating Python Strings