3. Variable, Expressions, Statements Flashcards
1
Q
i index is used when we want to make
A
a loop
2
Q
without i, the loop will continue
A
infintely
3
Q
elements needed in loop
A
Initialization Statement (i = x)
Loop Condition (if i == 10)
Update Statement (i = i+1)
4
Q
Use of type()
A
to get the type a value/variable belongs
5
Q
naming rules:
1st Character
A
- Alphabets (lowercase or uppercase)
* Underscore ( _ )
6
Q
naming rules:
2nd Character onwards
A
- Alphabets (lowercase or uppercase)
- Underscore ( _ )
- Digits
7
Q
naming rules:
CANNOT be
A
Python’s keywords,
8
Q
/
A
(floating-point division)
9
Q
//
A
(integer division)
10
Q
**
A
Exponentiation
11
Q
mod is the
A
remainder of a division
12
Q
str +
A
Concatenation
“Tony” + “Stark” = “TonyStark”
13
Q
str *
A
Repetition
“Tony” * 3 = “TonyTonyTony”
14
Q
Rules of Precedence =
A
PEMDAS
15
Q
Expressions
A
A combination of values, variables, and operators.