Page 101 - Digicode_AI_class_7
P. 101
REFRESH
A data type specifies the type of value a variable can contains.
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 operands are true (ii) Both operands are false
(iii) Either of the operands are true (iv) Neither of the operands is true
2. Which one of the following has the highest precedence in a logical expression?
(i) Addition (ii) Multiplication
(iii) Exponential (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 is not the conditional statement in Python?
(i) if Statement (ii) if…else Statement
(iii) if...elif...else Statement (iv) None of these
More on Python 99

