Python for Data Science (3150713) MCQs

MCQs of Getting Your Hands Dirty With Data

Showing 1 to 10 out of 17 Questions
1.

syntax to open file in python

(a)

fileobject = open(filename)

(b)

fileobject = fopen(filename)

(c)

fileobject = file(filename)

(d)

fileobject = openfile(filename)

Answer:

Option (a)

2.

How to get list of all lines from file in python

(a)

using readlines function

(b)

using listlines function

(c)

using read function

(d)

using readlist function

Answer:

Option (a)

3.

what is the use of wb accessmode while opeing a file in python

(a)

write and read

(b)

write a big file

(c)

write in binary

(d)

write in a big data

Answer:

Option (c)

4.

what is the correct way to specify absolute path while opeing a file in windows operating system.

(a)

f=open(‘D:\\folder\\subfolder\\filename.txt’)

(b)

f=open(‘D:\folder\subfolder\filename.txt’)

(c)

f=open(‘D:/folder/subfolder/filename.txt’)

(d)

f=open(‘D://folder//subfolder//filename.txt’)

Answer:

Option (a)

5.

what is the use of "with" statement in python

(a)

exception handling

(b)

pairing

(c)

database handling

(d)

access specifier

Answer:

Option (a)

6.

command to install numpy

(a)

pip install numpy

(b)

py install numpy

(c)

python install numpy

(d)

pi install numpy

Answer:

Option (a)

7.

which one of these can not be considered as a use of numpy

(a)

numeric computation 

(b)

image processing

(c)

database access

(d)

algebra & fourier transformation

Answer:

Option (c)

8.

type(Numpy Array) will return

(a)

array

(b)

ndarray

(c)

nuarray

(d)

nparray

Answer:

Option (b)

9.

what will be the output of the below script

(a)

[0 1 2 3 4 5 6 7 8 9]

(b)

[0 1 2 3 4 5 6 7 8 9 10]

(c)

[10]

(d)

error

Answer:

Option (a)

10.

what will be the output of the below script?

(a)

[0. 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1. ]

(b)

[0 1 2 3 4 5 6 7 8 9 10 ]

(c)

[0 1 2 3 4 5 6 7 8 9 10 11]

(d)

[0. 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1. 1.1]

Answer:

Option (a)

Showing 1 to 10 out of 17 Questions