Summative Quiz - Attempt Review
Summative Quiz - Attempt Review
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. ===
b.
The number of dimensions Correct
d.
The number of elements in each dimension Correct
Question 4 Which of the following would assign the letter 'G' as a value 'x'?
Correct
b.
x = 'Goldsmiths'[1]
c. x = 'Goldsmiths'.sub(0,1)
d. x = “Goldsmiths”[0] Correct!
Question 5 How do you create a variable with the integer value 17? Please select all correct answers.
Correct
b. x.value = 17
c. x = 17 Correct
d. x = int(17) Correct
c. {“data”:“science,” “Goldsmiths”:”University”}
b. null
c. False
d. NAN
Question 8 Which of the following are valid methods (modes) for opening a file? Please select all correct answers.
Correct
b.
Create – “x” Correct
b. List Correct!
c. Tuple
d. Dict
b. Tuple
c. List
c. if b > a: Correct
d. if(b > a)
c. Compile code
d. Run code
b. // This is a comment //
c.
"""
This is a comment
""" Correct
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
b. uses thisModule
d. #include thisModule
b. break Correct
c. stop
d. return
c. JSON
d. XML
Question 18
df.pivot_table(index='col1',values=['col2','col3'],aggfunc='mean') will create a pivot table...
Correct
b.
That groups by col2 and 3 and calculates the mean of col1
c.
d. That groups by col1 and calculates the mean of col2 and col3 Correct
Question 19
df.fillna(value=values, limit=1) will replace
Correct
b. All 1 values
b. print(dtype[x])
c. print(typeOf(x))
d. print(typeof x)