wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Data Analysis using Python

Total questions: 20

Worksheet time: 18mins

Name
Class
Date
1.

What is the result of 32 >> 2 ?

a)

32

b)

8

c)

16

d)

None

2.

What's wrong with the following program?

a)

Second print should not be indented

b)

First print should be indented

c)

if age > 18 is invalid

d)

age = 24 is invalid

3.

What is the value of X after solving the expression:

X = 10 / 2 * ( 3 >> 1 ) - 45 % 5 ?

a)

5

b)

10

c)

5.0

d)

7.5

4.

What is the throughput of the following line of code:

int ( '10.5' )

a)

10

b)

10.5

c)

ValueError

d)

10.0

5.

What is the output of the following program:

>>> list = [ 1, 2, 'Benjamin', 'studious' ]

>>> 'Benjamin is ' + list.pop( )

a)

Benjamin is studious

b)

Benjamin is

c)

Benjamin is 1 2 Benjamin

d)

Error

6.

Consider a dictionary named food. What food.items( ) return ?

a)

View object containing items

b)

Object containing items

c)

A dictionary

d)

None

7.

Spot the error in the following line:

dict = { 1: 'students', '2': 'faculties' }

a)

Key 1 should be quoted with single quotes

b)

Key 2 should not be quoted with single quotes

c)

Values should not be quoted with single quotes

d)

No Error

8.

for k in range (5, -4, -2):

print(k, end=' ')

a)

5 4 3 2 1 0 -1 -2 -3

b)

5 4 3 2 1 -1 -3 -4

c)

5 3 1

d)

5 3 1 -1 -3

9.

Determine the output of the following code:

a)

hi !

b)

hh ii !!

c)

hhii! !

d)

None

10.

Determine the output of the following code:

a)

11 13 14 16 17 19

b)

11 12 13 14 15 16 17 18 19

c)

11 13 14

d)

None

11.

What is the name of the test designed to determine a machine's ability to exhibit intelligent behaviour?

a)

Rorschach Test

b)

Miller Test

c)

Wechsler Test

d)

None

12.

How to access the value 16 in the given list?

a)

list3 [0][0][1]

b)

list3[0][0][0][0]

c)

list3[0][0][0][1]

d)

list3[0][0][0]

13.

What will be the output of the following code:

>>> a = [1, 2, 3]

>>> a.append([4, 5])

>>> print(a)

a)

[1, 2, 3, 4, 5]

b)

[1, 2, 3, [4, 5]]

c)

Error

d)

[1, 2, 3, 4]

14.

hat is the output of the following:

>>> aTuple = "Yellow", 20, "Red"

>>> a, b, c = aTuple

>>> print(a)

a)

(‘Yellow’, 20, ‘Red’)

b)

TyepeError

c)

Yellow

d)

None

15.

Determine the output of the following code:

>>> fruits = ('mango', 'orange', 'apple')

>>> *fruit1, fruit2, fruit3 = fruits

>>> fruit1

a)

'mango'

b)

['mango']

c)

[ 'mango', 'orange', 'apple' ]

d)

None

16.

What is the output of the following code:

>>> list = [ 1, 2, 3, 4, 5 ]

>>> list[0: ] = [10]

>>> list

a)

[10]

b)

[10, 2, 3, 4, 5]

c)

Error

d)

None

17.

What listQ is pointing to?

>>> list = [1, 2, 3, 4, 5]

>>> listQ = [ v**2 for v in list ]

>>> listQ

a)

[1, 2, 3, 4, 5]

b)

[2, 4, 6, 8, 10]

c)

[1**2, 2**2, 3**2, 4**2, 5**2]

d)

[1, 4, 9, 16, 25]

18.

What listQ is pointing to?

>>> list = [1, 2, 3, 4, 5]

>>> listQ = [ v**2 for v in list ]

>>> listQ

a)

[1, 2, 3, 4, 5]

b)

[2, 4, 6, 8, 10]

c)

[1**2, 2**2, 3**2, 4**2, 5**2]

d)

[1, 4, 9, 16, 25]

19.

Consider the following tuple:

>>> fruits = ('mango', 'orange', 'kiwi')

Which command can be used to change 'orange' to 'kiwi' ?

a)

fruits.update('orange', 'kiwi')

b)

fruits['orange'] = 'kiwi'

c)

fruits.change('orange', 'kiwi')

d)

None

20.

The command used to give heading of the paragraph is _______

a)

plt.show( )

b)

plt.label( )

c)

plt.xlabel( )

d)

plt.title( )