Skip to content

Module 4 challenge :Get Started with Python (Google Advanced Data Analytics Professional Certificate) Answers 2025

Question 1

Which statements accurately describe Python lists? (Select all)

  • Lists are mutable. ✅

  • Lists are immutable. ❌

  • Lists can contain sequences of elements of any data type. ✅

  • Lists can be indexed and sliced. ✅

Explanation:
Lists can be changed, store mixed types, and support indexing/slicing.


Question 2

If ‘Houston’ is the third element, it is at index 2. The correct code is:

  • cities.pop(1) ❌

  • cities.pop(4) ❌

  • cities.pop(3) ❌

  • cities.pop(2) ✅

Explanation:
List indexing starts at 0 → third element = index 2.


Question 3

What types of data can tuples contain? (Select all)

  • Modules ❌

  • Strings ✅

  • Floats ✅

  • Integers ✅

Explanation:
Tuples can hold any data type — just like lists — but are immutable.


Question 4

Character used to instantiate a dictionary:

  • ( ) ❌

  • < > ❌

  • { } ✅

Explanation:
Curly braces { } are used for dictionaries.


Question 5

Retrieve both keys and values:

  • employees.keys() ❌ (keys only)

  • items.employees() ❌

  • employees.items() ✅

  • keys.employees() ❌

Explanation:
.items() returns (key, value) pairs.


Question 6

Find elements present in A but not in B:

  • intersection() ❌

  • symmetric_difference() ❌

  • union() ❌

  • difference() ✅

Explanation:
A.difference(B) returns items only in A.


Question 7

Fill in the blank: In Python, _____ contain collections of functions and variables.

  • keywords ❌

  • logical operators ❌

  • comparators ❌

  • modules ✅

Explanation:
Modules package reusable functions and variables.


Question 8

A _____ NumPy array can be created from a list of lists of equal length.

  • two-dimensional ✅

  • one-dimensional ❌

  • four-dimensional ❌

  • three-dimensional ❌

Explanation:
A list of lists creates a 2D array (rows × columns).


Question 9

Mean of the Price column:

  • sales.mean().[Price] ❌

  • sales[‘Price’].mean() ✅

  • sales = mean().Price ❌

  • sales.(Price).mean() ❌

Explanation:
Access the column with sales['Price'] then call .mean().


Question 10

Difference between iloc[] and loc[]:

  • iloc merges… ❌

  • iloc selects by name… ❌

  • iloc selects by index; loc selects by name. ✅

  • iloc merges… ❌

Explanation:

  • iloc → integer positions

  • loc → label names


Question 11

Join that includes all keys from both dataframes:

  • Left join ❌

  • Inner join ❌

  • Outer join ✅

  • Right join ❌

Explanation:
Outer join keeps everything, filling in missing values with NaN.


🧾 Summary Table

Q# Correct Answer(s)
1 Mutable, mixed types, indexed & sliced
2 cities.pop(2)
3 Strings, Floats, Integers
4 { }
5 employees.items()
6 difference()
7 modules
8 two-dimensional
9 sales[‘Price’].mean()
10 iloc = index, loc = name
11 Outer join

ChatGPT can make mistakes