Python Operators Quiz

21

1 / 20

1) Find the literals with the truth-value?

2 / 20

2) Is it correct to use == operator to compare float values?

3 / 20

3) What is "y+z+6" in the below statement known as?
x = y+z+6

4 / 20

4) What is the output of the following code?

print(5 and 0)
print(5 and 10)
print(5 and 10 and 2)
print(0 and 5 and 10)

5 / 20

5) Variables y and z in the below statement are:
x = y+z+6

6 / 20

6) What is the output of the following code?

print('x' and 'None')
print('None' and 'x')

7 / 20

7) Which expression will increase the value of "a" 3 times?

8 / 20

8) What is the output of the following code?


print(2+2**3*2)

9 / 20

9) What is the output of the following code?

print('a' and 'b')
print('b' and 'a')

10 / 20

10) What is the output of the following code?

a = 1.0
print((a = 1)
print((a < 10.0) and 5)

11 / 20

11) What is the output of the following code?


x = 6.2
y = 3
z = 1
print(x//y)
print(y//z)

12 / 20

12) What is the output of the following code?

print('a' or "(")
print('a' and ")")

13 / 20

13) What is the output of the code:

import math
x = 25
print(x<50 and math.sqrt(x))
print(x>50 and math.sqrt(x))

14 / 20

14) Find operator with the least precedence?

15 / 20

15) What is the value of expression 10/2 and 10//2?

16 / 20

16) In which case x  is y is True?

17 / 20

17) Which operator is used to check if both the operands reference the same object memory?

18 / 20

18) Which function returns the unique number assigned to the object?

19 / 20

19) What is the output of the following code?
print(type('False' and False))
print(type('False' or False))

20 / 20

20) What is the output of the following code?


print(5 or 0)
print(5 or 10)
print(0 or 5 or 10)

Your score is

The average score is 58%

0%