The first MCQ relates to the introductory (intermediate) lesson on Python programming from the v 5.2 lessons: 01-intro-python
You have a Pandas dataframe (assigned to the variable
df) with the following data:
Which of the following code snippets will return the temperature and rainfall of rows 2 and 3?
You have the following list:
myList = [42, 1, 0, 'moon']. What output does the following code generate:
myList.reverse() print myList, myList[-1]
Answer 1 should diagnose whether the student has understood that
myList and should indicate whether the student has picked up on that Python starts numbering with 0, and not 1.
Answer 2 is intended to distinguish between cases where the student understands how the numbering of elements works and what the index -1 refers to, but that it has not understood how the
.reverse() method works
Answer 3 is the correct answer
Answer 4 is to diagnose whether the student has understood how
.reverse() works but not which element the index -1 refers to.