menu

Python Operators


1.

Which operator is used for concatenation of two strings in Python?

+

-

*

/


2.

What is the output of the following code?

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

2.5

2

3

3.5


3.

What is the output of the following code?

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

5

6

8

9


4.

What is the output of the following code?

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

2.5

3

2

3


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

==

=

!=

<> 


6. Which of the following operators is used for floor division in Python?

//

%

/

*


7. Which operator is used for exponentiation in Python?

**

^

*

//


8.

What is the output of the following code?

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

1

0

Error

None of the above


9.

What is the output of the following code?

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

1

3

0

10


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

^

**

%

/