0% found this document useful (0 votes)
15 views7 pages

Summative Quiz - Attempt Review

Uploaded by

Christopher Neo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views7 pages

Summative Quiz - Attempt Review

Uploaded by

Christopher Neo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Dashboard / My courses / Taught Courses / Data Science / 2020 / April 2020 Session / DSM020-2020-APR

/ Coursework and validation quiz submission / Summative quiz

Started on Sunday, 30 August 2020, 4:32 PM


State Finished
Completed on Sunday, 30 August 2020, 5:02 PM
Time taken 30 mins 18 secs
Grade 19.00 out of 20.00 (95%)

Question 1 pd.DataFrame(np.random.rand(25,4)) will produce randomised data with...


Correct

Mark 1.00 out of Select one:


1.00
a.
25 columns and 4 rows

b. Rows indexed by the 4th value

c. 4 columns and 25 rows  Correct

d. Columns indexed by the 25th value

Your answer is correct.


The correct answer is: 4 columns and 25 rows

Question 2 Comparison of two equal values under a set of logic or conditions utilises which operator(s)? Hint: The output should be
Correct 'true' when two variables are equal.
Mark 1.00 out of
1.00 Select one:
a. =

b. ==  Correct!

c. !=

d. ===

Your answer is correct.


The correct answer is: ==
Question 3 Consider a 2d array of odd and even numbers as follows
Correct
arr = np.array([[2,4,6,8,10], [1,3,5,7,9]])
Mark 1.00 out of
1.00 Printing the shape of the array would output

Select one or more:


a.
The elements in the array

b.
The number of dimensions  Correct

c. The median value of the contents of the array

d.
The number of elements in each dimension  Correct

Your answer is correct.

The correct answers are:


The number of elements in each dimension,
The number of dimensions

Question 4 Which of the following would assign the letter 'G' as a value 'x'?
Correct

Mark 1.00 out of Select one:


1.00
a. x = sub('Goldsmiths', 0, 1)

b.
x = 'Goldsmiths'[1]

c. x = 'Goldsmiths'.sub(0,1)

d. x = “Goldsmiths”[0]  Correct!

Your answer is correct.

Zero-based indexing is an important construct in programming.


The correct answer is: x = “Goldsmiths”[0]

Question 5 How do you create a variable with the integer value 17? Please select all correct answers.
Correct

Mark 1.00 out of Select one or more:


1.00
a. 17 = x

b. x.value = 17

c. x = 17  Correct

d. x = int(17)  Correct

Your answer is correct.

The correct answers are: x = 17, x = int(17)


Question 6 Which of these collections is a list?
Correct

Mark 1.00 out of Select one:


1.00
a. (“data”, “science,” “Goldsmiths”)

b. {“data”, “science,” “Goldsmiths”}

c. {“data”:“science,” “Goldsmiths”:”University”}

d. ["data", "science," "Goldsmiths"]  Correct!

Your answer is correct.

The correct answer is: ["data", "science," "Goldsmiths"]

Question 7 print(bool(123)) would return...


Correct

Mark 1.00 out of Select one:


1.00
a. True  Correct! Most boolean type checks return a truth value

b. null

c. False

d. NAN

Your answer is correct.

The correct answer is: True

Question 8 Which of the following are valid methods (modes) for opening a file? Please select all correct answers.
Correct

Mark 1.00 out of Select one or more:


1.00
a. Modify – “m”

b.
Create – “x”  Correct

c. Append - “a”  Correct

d. Insert into - “I”

Your answer is correct.

The correct answers are: Append - “a”,


Create – “x”
Question 9 A collection of data which is ordered, changeable and permits duplicate objects is...
Correct

Mark 1.00 out of Select one:


1.00
a. Set

b. List  Correct!

c. Tuple

d. Dict

Your answer is correct.

The correct answer is: List

Question 10 Duplicate objects are not permitted in a...


Correct

Mark 1.00 out of Select one:


1.00
a. Set  Correct!

b. Tuple

c. List

Your answer is correct.

The correct answer is: Set

Question 11 An if statement in Python can be written as follows...


Correct

Mark 1.00 out of


1.00
Select one:
a. if(b>a){}

b. if[b > a];

c. if b > a:  Correct

d. if(b > a)

Your answer is correct.

The correct answer is: if b > a:

Question 12 Escape characters are used to...


Correct

Mark 1.00 out of Select one:


1.00
a. Exit the application

b. Insert illegal characters  Correct!

c. Compile code

d. Run code

Your answer is correct.

The correct answer is: Insert illegal characters


Question 13
Comments in Python can be written as...
Correct

Mark 1.00 out of


1.00

Select one or more:


a.
/* This is a comment */

b. // This is a comment //

c.
"""
This is a comment
"""  Correct

d. # This is a comment  Correct

Your answer is correct.

The correct answers are: # This is a comment,


"""
This is a comment
"""

Question 14 Where
Correct
university = ['g', 'o', 'l', 'd', 's', 'm' ,'i' ,'t' ,'h' ,'s']
Mark 1.00 out of
1.00 What would be the output of

print(university[10:])?

Select one:
a. s,h,t,i,m,s,d,l,o,g

b. s

c. []  Correct

d. g

Your answer is correct.


The correct answer is: []

Question 15 We can utilise external modules in the following way...


Correct
Please select all correct answers.
Mark 1.00 out of
1.00
Select one or more:
a. import thisModule  Correct

b. uses thisModule

c. import thisModule as that  Correct

d. #include thisModule

Your answer is correct.


The correct answers are: import thisModule, import thisModule as that
Question 16 Which statement is used to stop a loop?
Correct

Mark 1.00 out of Select one:


1.00
a. exit

b. break  Correct

c. stop

d. return

Your answer is correct.

The correct answer is: break

Question 17 Jupyter Notebooks are which type of document...


Incorrect

Mark 0.00 out of Select one:


1.00
a. RDF

b. HTML  This is not correct

c. JSON

d. XML

Your answer is incorrect.

The correct answer is: JSON

Question 18
df.pivot_table(index='col1',values=['col2','col3'],aggfunc='mean') will create a pivot table...
Correct

Mark 1.00 out of Select one:


1.00
a. All of these answers are correct

b.
That groups by col2 and 3 and calculates the mean of col1

c.

That groups by columns 2 and 3 and aggregates all three columns

d. That groups by col1 and calculates the mean of col2 and col3  Correct

Your answer is correct.


The correct answer is: That groups by col1 and calculates the mean of col2 and col3

Question 19
df.fillna(value=values, limit=1) will replace
Correct

Mark 1.00 out of Select one:


1.00
a. The first NaN element  Correct!

b. All 1 values

c. NaN values in column 1

d. All NaN values

Your answer is correct.

The correct answer is: The first NaN element


Question 20 We can find out about the data type of an object using...
Correct

Mark 1.00 out of Select one:


1.00
a. print(type(x))  Correct!

b. print(dtype[x])

c. print(typeOf(x))

d. print(typeof x)

Your answer is correct.

The correct answer is: print(type(x))

◄ CW1 - Submission Jump to... 1.1 Introduction ►

You might also like