Python Programming - Operators Questions with Answers teach how to perform operations on data effectively. These Python Operators Questions are important for Infosys, Wipro, and SSC exams testing logical and arithmetic concepts
Python Operators
Showing 10 of
26 questions
1. What is the output of 5 ** 2 in Python?
10
25
7
Error
Answer: Option B
Hints: The ** operator is used for exponentiation in Python. 5 ** 2 means 5 raised to the power of 2, which equals 25.
2. Which operator is used for floor division in Python?
/
//
%
|
Answer: Option B
Hints: Floor division returns the largest integer that is less than or equal to the division result. The // operator is used for floor division in Python.
Answer: Option C
Hints: The += operator is an augmented assignment operator that adds the right operand to the left operand and assigns the result to the left operand.