Variables, Types & Operators · Question 5 · Easy

Which operator raises a number to a power in Python?

  1. ^
  2. **
  3. //
  4. %
Answer and explanation

Answer: B. **

Explanation: ** is the exponent operator, so 2 ** 5 is 32. ^ is bitwise XOR in Python, // is floor division and % is the remainder.

Previous: Which of the following is a valid Python variable name? · Next: Applying the usual operator precedence, what does this arithmetic expression…

Practise variables, types & operators

Try a fresh set of variables, types & operators questions with an explanation after every answer, free and without signing up: Variables, Types & Operators practice. Or sit a full placement mock test.

More variables, types & operators questions

More python practice

Python Strings · Lists & Tuples · Dictionaries & Sets · Conditions & Loops · Functions & Scope · Comprehensions & Generators · Classes & Objects · Exceptions & Files

LogicWiz Exams home · All practice topics · Placement mock tests · Daily 10 challenge