You are on page 1of 2

Today's Topics

======================
Operator
Condition
Loop and it's type
Beak and continue

Operator
================
Arithmeitc:
+ 2+3
- 2-3
* 2*3= 6
** 2**3 = 8 or 2^3
/ 23/10 = 2.3 (float)
// 23//10 = 2 (int)
% 23%10 = 3
Conditional:
>
>=
<
<=
==
!=

in
a =[111,222,343,455,3,40,3,3,4]
if 40 in a:
...
else:
..
not in

if 40 not in a:
..

else:
...

Logical:
and
or

Assignment Operator:
= a =10
+= a+=1 or a =a+1
-=
*=

Not allowed:
++
--

Condition:
=========================
Python doesn't support switch case

-if condition
-if else codnition
-if elif elif ... else / ladder if else
-nested if else / if inside if condition

Loop and it's type


=======================
Loop : is iterator or repeation of statement
Example:
1 2 3 ... 10

There are following concepts of loop:


-init / start from : 1
-condition / limit : 10
-steps/increment/decrement : +1

There are following types of loop:


-while loop
snyntax:
i =1 #init
while i<=10: #condition
i=i+1 #step/increment

-for loop

Questions:
B8-B10
B32-B40

You might also like