Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Data Types – GATE MCQS (Part 1)

Total questions: 25

Worksheet time: 50mins

Name
Class
Date
1.

What is the output? print(type(5/2))

a)

float

b)

int

c)

double

d)

complex

2.

Which of the following is a valid Python identifier?

a)

var-2

b)

var@2

c)

2var

d)

var_2

3.

What is the output? print("GATE" * 2)

a)

Error

b)

GATEGATE

c)

GATE GATE

d)

GATE2

4.

Which statement is TRUE about Python?

a)

Python variables must be declared

b)

Python is statically typed

c)

Python supports multiple inheritance

d)

Python does not support recursion

5.

Which of the following data types is immutable?

a)

tuple

b)

list

c)

set

d)

dictionary

6.

What is the output? a = (1, 2, 3) a[0] = 10 print(a)

a)

(1, 2, 3)

b)

None

c)

(10, 2, 3)

d)

Error

7.

Output of the code print(bool([0]))

a)

Error

b)

False

c)

True

d)

None

8.

What is the output? print(type({}))

a)

list

b)

dict

c)

set

d)

tuple

9.

What is the output of the code? print(int(5.9))

a)

Error

b)

5.9

c)

6

d)

5

10.

Select the valid string multiplication result.

a)

"py" * 3 gives error

b)

"py" * 3 gives pypypy

c)

"py" * 3 gives py py py

d)

"py" * 3 gives pypy

11.

Which of the following cannot be a Python identifier?

a)

VALUE

b)

_value

c)

value2

d)

for

12.

Which of the following creates a set?

a)

()

b)

[]

c)

{}

d)

set()

13.

Output of the code print(5 // 2)

a)

Error

b)

3

c)

2

d)

2.5

14.

What is the output? print(2 ** 3 ** 2)

a)

Error

b)

16

c)

512

d)

64

15.

Which operator checks object identity?

a)

==

b)

=

c)

!=

d)

is

16.

Output of the code a = 5 b = 5 print(a is b)

a)

None

b)

Error

c)

False

d)

True

17.

What is the output? print(True + True)

a)

1

b)

2

c)

Error

d)

True

18.

Which operator has the highest precedence?

a)

+

b)

*

c)

**

d)

%

19.

What is the output of the code? x = [1, 2, 3] y = x y[0] = 10 print(x)

a)

[1, 10, 3]

b)

Error

c)

[10, 2, 3]

d)

[1, 2, 3]

20.

Which of the following is a mutable data type in Python?

a)

frozenset

b)

str

c)

list

d)

tuple

21.

What is the output? print(3 == 3.0)

a)

Error

b)

False

c)

None

d)

True

22.

What is the output? print("Hello" + " World")

a)

"Hello" + " World"

b)

Error

c)

Hello World

d)

HelloWorld

23.

Which of the following is a valid way to create a list in Python?

a)

list = (1, 2, 3)

b)

list = <1, 2, 3>

c)

list = [1, 2, 3]

d)

list = {1, 2, 3}

24.

What is the output? print(len("Python"))

a)

5

b)

6

c)

Error

d)

None

25.

Which of the following is a valid way to create a dictionary in Python?

a)

dict = (1, 2, 3)

b)

dict = <1, 2, 3>

c)

dict = {"key": "value"}

d)

dict = [1, 2, 3]