Page 484 - ComputerScience_Class_11
P. 484
Output
Original value: 50
Type of original value: <class ‘str’>
After converting to integer: 50
Type: <class ‘int’>
After converting to float: 50.0
Type: <class ‘float’>
After converting to string: 50.0
Type: <class ‘str’>
Let’s Revisit
♦ An operator is a special symbol or keyword in Python that tells the computer to perform a specific operation on one or more
values, called operands.
♦ A binary operator in Python is a type of operator that works on two operands to perform an operation.
♦ Arithmetic operators are used to perform mathematical operations, including addition, subtraction, multiplication, division,
modulus, exponentiation and floor division.
♦ Logical operators are used to perform logical operations on two or more conditions.
♦ Identity operators are used to determine whether two variables point to the same object in memory.
♦ A simple statement in Python is a statement that is written in a single line and completed by pressing the Enter key.
♦ Type conversion in Python is the process of changing a value from one data type to another, ensuring that operations and
calculations work correctly.
MIND DRILL
Solved Questions
A. Tick ( ) the correct option.
1. Select the correct operator used for addition in Python.
a. * b. +
c. / d. -
2. Choose the correct description for the operator == in Python.
a. Checks if two operands are equal
b. Checks if two operands are not equal
c. Checks if the left operand is greater than the right operand
d. Checks if the left operand is less than the right operand
3. Where are bitwise operators primarily used in Python?
a. High-level programming b. Low-level programming and data manipulation
c. String manipulation d. Database management
4. What will be the output of the following expression in Python: 5 // 2?
a. 5 b. 2.5
c. 3 d. 2
482 Touchpad Computer Science (Ver. 3.0)-XI

