menu

Python Operators


1. Which operator is used for exponentiation in Python?

**

^

*

//


2.

What is the output of the following code snippet?

a = 5
b = 2
print(a//b)

2.5

2

3

2


3. Which of the following is the correct operator for exponentiation in Python?

^

**

%

/


4.

What is the output of the following code?

x = 5
y = 2
print(x > y)

1

0

Error

None of the above


5. Which operator is used for checking if two values are equal in Python?

==

=

!=

<> 


6.

What is the output of the following code?

a = 2
b = 5
print(a * b ** 2)

50

35

20

10


7.

What is the output of the following code snippet?

a = 5
b = 2
print(a%b)

2.5

2

1.5

1


8.

What is the output of the following code?

a = 5
b = 2
print(a % b)

2.5

2

1

0.5


9.

What is the output of the following code?

a = 10
b = 3
print(a // b)

3.33

3

3

10


10.

What is the output of the following code?

a = 10
b = 3
print(a % b)

0

1

2

3