Python Foundations for Analytics — Quiz

Answer all 12 questions, then submit. You need 70% to pass. Log in to save progress.

Question 1
Which tool lets you run Python in the browser with nothing to install?
A Microsoft Excel
B Google Colab
C Notepad
D Power BI
Question 2
What does len([10, 20, 30]) return?
A 60
B 3
C 30
D [10, 20, 30]
Question 3
Which type best represents a single labelled record such as a customer row?
A list
B dict
C int
D bool
Question 4
In Python, how is a block of code (e.g. inside an if) defined?
A With curly braces { }
B With indentation (spaces)
C With the word END
D With parentheses ( )
Question 5
What does this list comprehension produce: [a for a in [5, 12, 8] if a > 7]?
A [5]
B [12, 8]
C [5, 12, 8]
D [12]
Question 6
Why wrap float(value) in a try / except when reading data?
A To make it run faster
B To recover gracefully when a value is blank or not a number
C To convert numbers to text
D It is required by all functions
Question 7
Which keyword brings an external library such as statistics into your script?
A include
B using
C import
D load
Question 8
What is the safest way to open a file so it is always closed properly?
A open('f.csv') and forget it
B with open('f.csv') as f:
C file = f.csv
D read('f.csv')
Question 9
csv.DictReader turns each CSV row into a…
A list of numbers
B single string
C dict keyed by the column headers
D DataFrame
Question 10
Which function converts a Python object into JSON text?
A json.loads()
B json.dumps()
C json.read()
D str()
Question 11
Put the everyday Git workflow in order:
A push → commit → add
B add → commit → push
C commit → add → push
D init → push → add
Question 12
What makes a notebook 'reproducible'?
A It has many charts
B It runs top-to-bottom without errors after a kernel restart
C It is saved as a PDF
D It uses the newest Python