Variables, Types & Operators · Question 5 · Easy
Which operator raises a number to a power in Python?
- ^
- **
- //
- %
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
- Riya shares 17 chocolates equally among 5 friends and keeps the leftovers…
- A roll number typed as text is converted before adding. What is printed?
- Which of the following is a valid Python variable name?
- Applying the usual operator precedence, what does this arithmetic expression…
- An integer is added to a float. What does Python print for the sum?
- Floor division and remainder are applied to a negative number. What is the…
- Unary minus meets the power operator, with and without brackets. What does…
- How many values in the list vals are treated as true by the if test?
- A voter-age check uses chained comparisons. What does it print for age 21?
- Two separate lists hold the same values and a third name points to the first…
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