Page 101 - Dig_CodeAI_V2.1_Class_7
P. 101
REFRESH
Data types are used to define the type of value a variable can contain.
Comments enable us to understand the way a program works.
Operators can be defined as special symbols which perform arithmetic and logical computation.
Arithmetic operators perform arithmetic operations between two operands.
Assignment operators are used to assign the value of the right expression to the left operand.
Relational operators are used to compare the value of the two operands and returns True or False
accordingly.
Precedence of operators determines the order in which the operators are executed.
The if statement is the simplest conditional statement.
In the if…else statement, if the condition evaluates to True, the indented block following the if
statement is executed, otherwise the indented block after the else statement is executed.
Python allows the nested if statement.
The if…elif…else ladder helps us to test multiple conditions and follows a top-down approach.
TeCh Ready
A. Tick ( ) the correct option.
1. The statement using AND operator results true if .
(i) Both conditions are true (ii) Both conditions are false
(iii) Either of the conditions are true (iv) Neither of the conditions is true
2. Which one of the following has the highest precedence in a logical expression?
(i) Addition (ii) Multiplication
(iii) Exponentiation (iv) Parentheses
3. Which of the following symbol(s) is/are used for comments in Python?
(i) // (ii) "
(iii) /**/ (iv) #
4. Which of the following conditional statements is used to test multiple conditions?
(i) if (ii) if…else
(iii) if…elif…else (iv) All of these
5. Which of the following operator reverses the result, returns false, if the result is true or vice versa?
(i) AND (ii) OR
(iii) NOT (iv) None of these
More on Python 99

