P2 260 Reviewer
P2 260 Reviewer
LOOP CONDITION
Type of repetition
-use true\false
2 way of increment by 1
1. num = num + 1
2. num + = 1
2 way of decrement by 1
1. num = num – 1
2. num - = 1
WHILE LOOP
Example:
ELSE STATEMENT WITH LOOP
Example:
Module 11:
LOOP
Iteration_var
Example:
-offset
Example:
ELSE STATEMENT WITH LOOP
Example:
FUNCTION RANGE
RANGE (n)
-starting from 0
Example:
starting to stop -1
Example:
Example:
NESTED LOOP
Break statement
Pass statement
-no operation
-indicate “null”
Module 13:
- making decision
1. NOT
-evaluate first
2. AND
-evaluate next
3. OR
-evaluate last
Level of precedence
1. NOT - high
2. AND - medium
3. OR - low
QUIZ P2:
MODULE 15:
-before written to the screen, the object will converted into a STRING
Print(object(s)
example :
0 – default
Example:
syntax – (x, y, z)
example:
sum() – iterable
Example:
dict – namespace
example: