wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Operators and Data types

Total questions: 32

Worksheet time: 43mins

Name
Class
Date
1.

Is Python case sensitive?

a)

Yes

b)

No

c)

Maybe

d)

Depends up on the version of python

2.

Which of the following is the correct extension of the Python file?

a)

.python

b)

.pl

c)

.py

d)

.p

3.

Is Python code compiled or interpreted?

a)

Python code is both compiled and interpreted

b)

Python code is neither compiled nor interpreted

c)

Python code is only compiled

d)

Python code is only interpreted

4.

Which of the following character is used to give single-line comments in Python?

a)

//

b)

#

c)

!

d)

/*

5.

Which of the following functions is a built-in function in python?

a)

fact()

b)

print()

c)

seed()

d)

squareroot()

6.

Which code is correct?

a)

ptinf("Hello World")

b)

print("Helloworld")

c)

printf "hello world"

d)

print (hello world)

7.

Which symbol is used for product calculations?

a)

x

b)

X

c)

*

d)

**

8.

Which one is integer datatype?

a)

w=1

b)

x=10.00

c)

y=010010123459714523697

d)

z=xa

9.

Select the string datatypes.

a)

+91547963

b)

B+ve

c)

1243

d)

5679 222^2  

10.

Dictionary is an unordered set of a key-value pair of items. This statement is.......

a)

True

b)

False

11.

Which of the following is invalid?

a)

_a = 1

b)

__a = 1

c)

__str__ = 1

d)

none of the mentioned

12.

Which of the following is an invalid variable?

a)

my_string_1

b)

1st_string

c)

foo

d)

_

13.

Which of the following is an invalid statement?

a)

abc = 1,000,000

b)

a b c = 1000 2000 3000

c)

a,b,c = 1000, 2000, 3000

d)

a_b_c = 1,000,000

14.

What is the answer to this expression, 22 % 3 is?

a)

7

b)

1

c)

0

d)

5

15.

Mathematical operations can be performed on a string.

a)

True

b)

False

16.

Which of these in not a core data type?

a)

Lists

b)

Dictionary

c)

Tuples

d)

Class

17.

What data type is the object below?

L = [1, 23, 'hello', 1]

a)

list

b)

dictionary

c)

array

d)

tuple

18.

In order to store values in terms of key and value we use what core data type.

a)

list

b)

tuple

c)

class

d)

dictionary

19.

print(7//2)

a)

2

b)

3

c)

4

20.

print(9>2 and 6<=6)

a)

TRUE

b)

FALSE

21.

print(8!=8)

a)

TRUE

b)

FALSE

22.

print(2**3)

a)

6

b)

12

c)

8

23.

print((15%4))

a)

4

b)

5

c)

3

24.

print("3"+"3")

a)

33

b)

6

c)

INVALID OUTPUT

25.

print(not (0<1))

a)

TRUE

b)

FALSE

c)

TYPE ERROR

26.

print(2%2==0 or 3%2==0)

a)

TRUE

b)

FALSE

c)

INVALID OUTPUT

27.

print(5+8*2)

a)

26

b)

21

c)

169

28.

print(4+"2")

a)

6

b)

42

c)

TYPE ERROR

29.

What is the value of the expression 100 / 25?

a)

4

b)

4.0

c)

"4.0"

d)

'4.0'

30.

x = 5

y = 3


print(x == y)

a)

True

b)

False

31.

x = 5

y = 3


print(x != y)

a)

True

b)

False

32.

x = 5


x%=3


print(x)

a)

2

b)

2.0

c)

3

d)

3.0