wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

First-Game-DSI8

Total questions: 39

Worksheet time: 23mins

Name
Class
Date
1.

Typing the command cd with no parameters will :

a)

change directory to the desktop

b)

nothing , because we did not specify the directory name

c)

takes us to our home directory

d)

takes us to the sub-directory

2.

To make a new directory , the command that we should write is :

a)

pwd folder

b)

cd folder

c)

mkdir folder

d)

touch file1

3.

This command will always give you the absolute path of your current location:

a)

touch

b)

cd

c)

pwd

d)

mkdir

4.

Writing the path on the provided image to access the intro_to_git folder is done using :

a)

Relative path

b)

Absolute path

5.

After executing this command:

rm file1

what will happen to file1?

a)

file1 will be removed

b)

file1 name will be changes to untitled

c)

it will list files located in file1

d)

nothing , rm is not a command

6.

The command that makes a copy of a repository into a newly created directory, with a reference still pointing to the original repository :

a)

git clone

b)

git push

c)

git add .

d)

git status

7.

Git is a based hosting service for Github repositories, while Github is a version control system (VCS):

a)

True

b)

False

8.

In git : you can commit your changes first, and after that, you can add one or more files to the index:

a)

True

b)

False

9.

By using this command you can updates a remote copy of the repository with local changes:

a)

git push

b)

git pull

c)

git add .

d)

git commit

10.

This command will updates a local copy of the repository with remote changes :

a)

git pull

b)

git push

c)

git status

d)

git add .

11.

What is the output of the following code snippet:

a)

corge

qux

baz

Done.

b)

corge

qux

baz

bar

foo

Done.

c)

The snippet doesn’t generate any output.

d)

corge

qux

baz

12.

What is the output of the following code snippet:

a)

It will print the sentence for 8 times

b)

it will not print anything because there is no specific condition

c)

it will initiate an infinite loop

d)

Will stop one the variable is false.

13.

How do you start writing a while loop in Python?

a)

while x>4 {

b)

while x>4 (

c)

while x>4 :

d)

x>4 while :

14.

Which statement is used to stop a loop?

a)

break

b)

stop

c)

return

d)

exit

15.

Will the print() statement on line 5 be executed in this case:

a)

Yes

b)

No

16.

What will be the output of the following Python code?

a)

2 4 6 8 10 …

b)

2 4

c)

2 3

d)

error

17.

What will be the output of the following Python code?

a)

True

b)

False

c)

None

d)

none of the mentioned

18.

Similarities between Lists and Arrays (np.array) are:

you can choose more than one answer:

a)

Both are used for storing data

b)

Both are mutable

c)

Both can be indexed and iterated through

d)

Both can be sliced

19.

What is the output of the following code snippet:

a)

it will not work , we should have a two vectors with equal dimensions

b)

[ 4, 5, 11]

c)

[ [4], [5], [11]]

d)

[[ 4, 5, 11], [ 5, 6, 12]]

20.

if we try to do a summation between two vectors and one of the vector of shape [1,3] and another one of shape [3,1] we will end up with :

a)

error because they are in different shapes

b)

a matrix of shape [3,3]

c)

a vector of shape [3,3]

d)

scalar multiplication

21.

k = [print(i) for i in my_string if i not in "aeiou"]

a)

prints all the vowels in my_string

b)

prints all the consonants in my_string

c)

prints all characters of my_string that aren’t vowels

d)

prints only on executing print(k)

22.

my_string = "hello world"


k = [(i.upper(), len(i)) for i in my_string]


print(k)

a)

[(‘HELLO’, 5), (‘WORLD’, 5)]

b)

[(‘H’, 1), (‘E’, 1), (‘L’, 1), (‘L’, 1), (‘O’, 1), (‘ ‘, 1), (‘W’, 1), (‘O’, 1), (‘R’, 1), (‘L’, 1), (‘D’, 1)]

c)

[(‘HELLO WORLD’, 11)]

d)

none of the mentioned

23.

x = [i**+1 for i in range(3)]; print(x);

a)

[0, 1, 2]

b)

[1, 2, 5]

c)

error, **+ is not a valid operator

d)

error, ‘;’ is not allowed

24.

What will be the output of the following Python code snippet?


d = {"john":40, "peter":45}


print(list(d.keys()))

a)

[“john”, “peter”]

b)

[“john”:40, “peter”:45]

c)

(“john”, “peter”)

d)

(“john”:40, “peter”:45)

25.

What will be the output of the following Python code?


print("abc DEF".capitalize())

a)

abc def

b)

ABC DEF

c)

Abc def

d)

Abc Def

26.

print([i.lower() for i in "HELLO"])

a)

[‘h’, ‘e’, ‘l’, ‘l’, ‘o’]

b)

‘hello’

c)

[‘hello’]

d)

hello

27.

Which method from the options given below can Read large text presented as comma-separated values?

a)

read_json

b)

read_pickle

c)

read_hdf

d)

read_csv

28.

Which of the following can be used to make a Dataframe?

a)

Series

b)

DataFrame

c)

Structured ndarray

d)

All of the above

29.

If data is an ndarray, the index length must be the same as the length of the data .

a)

True

b)

False

30.

What is the order of a matrix in Python?

a)

number of rows X number of columns

b)

number of columns X number of rows

c)

number of rows X number of rows

d)

number of columns X number of columns

31.

Which of the following is not a Python built-in function:

a)

map()

b)

diff()

c)

isinstance()

d)

round()

32.

Which of these measures are used to analyze the central tendency of data?

a)

Mean and Normal Distribution

b)

Mean, Median and Mode

c)

Mode, Alpha & Range

d)

Standard Deviation, Range and Mean

33.

Which of the following measures of central tendency will always change if a single value in the data changes?

a)

Mean

b)

Median

c)

Mode

d)

All of these

34.

Below are the distributions for Negatively, Positively and no skewed curves. Which one has: Mode<Median<Mean

a)

A

b)

B

c)

C

35.

Standard deviation can be negative.

a)

True

b)

False

36.

Standard deviation is robust to outliers?

a)

TRUE

b)

False

37.

The standard normal curve is symmetric about 0 and the total area under it is 1.

a)

TRUE

b)

FALSE

38.

Suppose you have been given a variable V, along with its mean and median. Based on these values, you can find whether the variable “V” is left skewed or right skewed for the condition:

mean(V) > median(V)

a)

TRUE

b)

FALSE

39.

type(range(5))

a)

int

b)

list

c)

range

d)

object