Python Operators Quiz

Test your understanding of python operators! In this quiz, 20 questions have been asked from the python operators topic.

If you have not read the Python operators article, read first – Python Operators

0%

Python Quiz

python mcq

Python Operators Quiz

1 / 20

1. What is the output of this code?

a = "Hello"

b = a

print(a is b)

2 / 20

2. What is the output of this code?

a = "cyberfauz"

print("y" in a)

3 / 20

3. What is the output of this code?

a = 2

c = a +10

d = 12

if(c == d):

print("1")

else:

print("0")

 

4 / 20

4. What is the output of this code?

a = 10

b = 4

c = a % b

print(b % c)

5 / 20

5. Which of the following is not an Arithmetic Operator?

6 / 20

6. What is the output of this code?

a = 10

a += 2

a *= 2

print(a)

7 / 20

7. What is the output of this code?

a = 20

b = 4

print(a//b)

8 / 20

8. What is the output of this code?

print(25 % 4 * 2)

9 / 20

9. Which of the following is not a logical operator?

10 / 20

10. What is the total number of identity operators in python?

11 / 20

11. Which of the following is an identity operator?

12 / 20

12. What is the output of this code?

a = "Hello"

b = len(a)

b += 5

b -=2

print(b)

13 / 20

13. What is the output of this code?

a = 10

b = 3

print(a % b)

14 / 20

14. What is the total number of membership operators in python?

 

15 / 20

15. What is the output of this code?

print(2**2**3)

16 / 20

16. What is the output of this code?

var = len("cyberfauz")%2

print(var)

17 / 20

17. What is the output of this code?

a = 10

b = 10

print(a is b)

18 / 20

18. What is the output of this code?

a = 10

b = 10

print(a>b)

19 / 20

19. What is the output of this code?

a = 10

b = 5

c = 20

d = a + b + b

print(c,d)

20 / 20

20. What is the output of this code?

a = 1

b = 0

if(a == 1 and b != 1):

print("Hello")

else:

print("Hye")

 

Your score is

The average score is 42%

0%