Overview
Introduction to Data Analysis Using Python is the seventh required course and, at about 27 listed hours, the longest. It teaches Python from the ground up for analysts: why data professionals use it, object-oriented ideas such as objects, attributes and methods, working in Jupyter Notebooks, and variables and data types. It then covers functions and conditional statements, while and for loops, string indexing, slicing and formatting, and finally Python's core data structures (lists, tuples, dictionaries and sets) with an introduction to NumPy arrays, pandas, data cleaning and binning.
The course gives the certificate a scripting tool for the same work done in spreadsheets and SQL: filtering, transforming and summarizing data, but in reusable code. Earlier versions of the certificate taught R at this point; the current Coursera course list uses Python.
How it's tested
Course 7 module challenges are code-reading items. You are shown a few lines of Python and asked what they print or return, which line causes an error, which data structure fits a need, or how to complete a function. Trace the code line by line, tracking each variable's value, rather than guessing from what the code seems intended to do.
-
Predict the output
A short snippet with a loop, slice, conditional or function call is shown and you choose what it prints or returns.
-
Pick the structure
A need such as storing unique values, pairing keys with values or holding fixed coordinates is described and you choose a set, dictionary, tuple or list.
-
Find the bug
Code that errors or loops forever is shown and you identify the cause, such as a missing colon, a wrong type or a condition that never becomes false.
A snippet sets city = 'Chicago' and asks what city[1:4] returns. Candidates who count from one choose 'Chic' or 'hica'. Python indexes from zero, so index 1 is 'h', and a slice stops before its end index, so it takes indices 1, 2 and 3. The result is 'hic'. Writing the indices under each character takes seconds and prevents the error.
Modules 4
Official modules from the Google outline, in outline order.
7.1 Hello, Python!Python's role for data professionals, object-oriented basics, Jupyter, variables and data types.
- What it means
- Python is a general-purpose, readable programming language with extensive libraries for data work. Everything in Python is an object with a type, attributes (stored values) and methods (functions belonging to the object), usually written in Jupyter Notebooks of code and markdown cells.
- What to understand
- Variables are created by assignment with =, are case-sensitive, must start with a letter or underscore, and cannot be Python keywords. Core data types are int, float, str and bool; type() reveals a value's type, and functions such as int() and str() convert between types. Python is dynamically typed, so a variable's type follows the value it currently holds.
- How it shows up
- A short assignment sequence is shown and you identify a variable's type or value, or which variable name is invalid.
- Common confusion
- Expecting '5' + 5 to equal 10; adding a string and an integer raises a TypeError until one is converted.
7.2 Functions and conditional statementsCalling and defining functions, if/elif/else decisions and clean, reusable code.
- What it means
- Functions are reusable blocks of code; built-in functions include print(), len(), type() and max(), and you define your own with def. Conditional statements use comparison and logical operators to choose which code runs.
- What to understand
- Parameters are the names in a function definition; arguments are the values passed in. return sends a value back to the caller, whereas print only displays it, so a function without return gives None. In an if/elif/else chain only the first true branch runs; == compares values, = assigns them, and and, or, not combine conditions.
- How it shows up
- A function and a call are shown and you predict the returned value, or a conditional chain is shown and you identify which branch runs.
- Common confusion
- Assuming a function that prints a result also returns it; storing its output in a variable gives None.
7.3 Loops and stringsWhile and for loops, plus string indexing, slicing and formatting.
- What it means
- Loops repeat code: a while loop runs while a condition is true, and a for loop iterates over a sequence such as a list, a string or range(). Strings are immutable sequences of characters that can be indexed, sliced and formatted.
- What to understand
- range(start, stop, step) stops before stop, so range(1, 5) gives 1 to 4. break exits a loop and continue skips to the next iteration. String indexes start at 0, negative indexes count from the end, and a slice [a:b] includes a but excludes b. Methods such as upper(), lower(), split() and format(), and f-strings, transform or build strings.
- How it shows up
- A loop or slice is shown and you predict the output, or a while loop is shown and you identify why it never ends.
- Common confusion
- Forgetting to update the loop variable in a while loop, which creates an infinite loop.
7.4 Data structures in PythonLists, tuples, dictionaries, sets and arrays, with data cleaning, binning, NumPy and pandas.
- What it means
- Data structures organize values: lists are ordered and mutable, tuples are ordered and immutable, dictionaries map unique keys to values, and sets hold unordered unique elements. NumPy provides fast arrays of a single data type, and pandas provides DataFrames for tabular data.
- What to understand
- Use a list for an ordered collection you will change, a tuple for fixed records, a dictionary for lookups by key and a set for removing duplicates or comparing groups with union and intersection. NumPy arrays support vectorized operations on whole arrays at once. A pandas DataFrame is a table of rows and columns where each column is a Series; binning groups continuous values into ranges, such as ages into bands.
- How it shows up
- A need such as removing duplicate IDs or looking up a price by product code is described and you pick the structure, or a short list or dictionary operation is shown and you predict the result.
- Common confusion
- Trying to change an element of a tuple; tuples are immutable, so the code raises an error.
High-yield concepts
The terms, rules and formulas this domain turns into questions most often.
-
Zero-based indexing and slicing
Python counts positions from 0, and a slice [start:stop] includes start but excludes stop.
- Remember
- 'Python'[0:2] is 'Py'; 'Python'[-1] is 'n'.
- Tested as
- Output-prediction items on strings and lists.
- Trap
- Counting from 1 or including the stop index.
-
Core data types
int for whole numbers, float for decimals, str for text and bool for True or False.
- Remember
- type() reveals the type, and int(), float() and str() convert between them.
- Tested as
- Type-identification and error items.
- Trap
- Thinking 3.0 is an int or '3' is a number.
-
Objects, attributes and methods
In object-oriented programming, objects bundle data (attributes) and behavior (methods), accessed with dot notation.
- Remember
- name.upper() calls a method; df.shape reads an attribute without parentheses.
- Tested as
- Module 1 vocabulary items.
- Trap
- Adding parentheses to attributes or leaving them off methods.
-
Assignment vs. comparison
= assigns a value to a variable; == tests whether two values are equal.
- Remember
- Conditions in if statements use ==, !=, <, >, <= and >=.
- Tested as
- Bug-finding items.
- Trap
- Writing if x = 5, which is a syntax error.
-
return vs. print
return sends a value back to the caller and ends the function; print displays a value but returns None.
- Remember
- Use return when the result must be stored or reused.
- Tested as
- Function-output items.
- Trap
- Expecting a printing function's result to be stored in a variable.
-
if/elif/else
A chain of conditions where only the first true branch runs and else catches everything else.
- Remember
- Order conditions from most specific to least specific.
- Tested as
- Branch-tracing items.
- Trap
- Expecting several elif branches to run when more than one condition is true.
-
for, while and range()
for loops iterate over a sequence; while loops repeat while a condition holds; range() generates integer sequences.
- Remember
- range(0, 10, 2) gives 0, 2, 4, 6, 8; the stop value is never included.
- Tested as
- Loop-output items.
- Trap
- Forgetting to change the condition variable in a while loop.
-
Mutable vs. immutable
Mutable objects such as lists, dictionaries and sets can be changed in place; immutable objects such as strings and tuples cannot.
- Remember
- String methods return a new string; the original stays the same.
- Tested as
- Structure-choice and error items.
- Trap
- Expecting name.upper() alone to change name.
-
Dictionary
A collection of key-value pairs, such as {'SKU1': 9.99}, accessed by key.
- Remember
- Keys must be unique and immutable; .keys(), .values() and .items() return their contents.
- Tested as
- Lookup-structure items.
- Trap
- Accessing a dictionary by position like a list.
-
Set
An unordered collection of unique elements that supports union, intersection and difference.
- Remember
- Converting a list to a set removes duplicates but loses order.
- Tested as
- Uniqueness and comparison items.
- Trap
- Expecting a set to keep insertion order or allow indexing.
-
NumPy array
A fast, fixed-type array that supports vectorized math on every element at once.
- Remember
- Array elements share one data type, unlike a Python list.
- Tested as
- Module 4 items on arrays.
- Trap
- Writing a loop to multiply every value when array * 2 does it directly.
-
pandas DataFrame and Series
A DataFrame is a two-dimensional table of labeled rows and columns; each column is a Series.
- Remember
- pandas mirrors spreadsheet and SQL operations such as filtering rows, selecting columns and grouping.
- Tested as
- Introductory pandas items.
- Trap
- Confusing a single column (Series) with the whole table (DataFrame).
Side by side
Concepts candidates mix up, compared on the point that decides the answer.
List vs. tuple vs. dictionary vs. set
| Concept | Meaning | Key difference | Common trap |
|---|---|---|---|
| List | Ordered, mutable sequence in square brackets | Change, add or remove items by position | Using it when values must not change |
| Tuple | Ordered, immutable sequence in parentheses | Cannot be changed after creation | Trying to assign to an element |
| Dictionary | Key-value pairs in braces | Fast lookup by unique key | Accessing by numeric position |
| Set | Unordered collection of unique items | Removes duplicates; supports union and intersection | Expecting order or indexing |
return vs. print
| Concept | Meaning | Key difference | Common trap |
|---|---|---|---|
| return | Sends a value back to where the function was called | Value can be stored and reused; ends the function | Placing code after return and expecting it to run |
| Displays a value on screen | Function still returns None | Assigning a printing function's output and getting None |
for loop vs. while loop
| Concept | Meaning | Key difference | Common trap |
|---|---|---|---|
| for loop | Iterates over each item of a sequence or range | Number of repetitions set by the sequence | Off-by-one errors with range's stop value |
| while loop | Repeats while a condition is true | Runs until the condition changes | Infinite loop when the condition variable never updates |
Exam traps
Each trap is an answer that looks right. Learn the clue that should change your mind.
-
Slice includes the end
- What candidates pick
- 'Data'[0:3] returns 'Data'.
- Why it looks right
- Index 3 is the last letter, so it seems included.
- Why it's wrong
- Slices exclude the stop index, so the result is 'Dat'.
Clue to watch for Any [start:stop] expression; count the stop as excluded.
-
range includes stop
- What candidates pick
- for i in range(1, 5) prints 1 through 5.
- Why it looks right
- Five appears in the call.
- Why it's wrong
- range stops before its stop value, printing 1, 2, 3 and 4.
Clue to watch for A loop over range with explicit start and stop.
-
Printed is returned
- What candidates pick
- total = add(2, 3) stores 5 when add only prints the sum.
- Why it looks right
- 5 appears on screen.
- Why it's wrong
- Without return, the function returns None, so total is None.
Clue to watch for A function body that ends with print and no return statement.
-
Every true branch runs
- What candidates pick
- Both the if and elif branches run when both conditions are true.
- Why it looks right
- Both conditions are satisfied.
- Why it's wrong
- In an if/elif/else chain, Python runs only the first true branch and skips the rest.
Clue to watch for A value that meets more than one condition in the chain.
-
String methods change the original
- What candidates pick
- After name.upper(), name is uppercase.
- Why it looks right
- The method was called on name.
- Why it's wrong
- Strings are immutable; upper() returns a new string that must be assigned, such as name = name.upper().
Clue to watch for A method call whose result is not assigned to anything.
-
List for unique values
- What candidates pick
- A list to store each unique customer ID once.
- Why it looks right
- Lists are the most familiar structure.
- Why it's wrong
- A list allows duplicates; a set enforces uniqueness automatically.
Clue to watch for The words 'unique', 'distinct' or 'remove duplicates'.
Answer framework
Use these steps on any Course 7 item that shows Python code or asks which construct to use.
- Write down each variable's starting value and type before reading further. Note whether each value is a string, number or boolean.
- Trace the code line by line, applying zero-based indexing and excluded stop values for slices and range().
- In conditionals, stop at the first true branch; in while loops, confirm the condition eventually becomes false.
- Check whether functions return or only print, and whether methods change an object or return a new one. Remember that unassigned string method results are lost.
- For structure choices, match the need: list for ordered changes, tuple for fixed records, dictionary for key lookups, set for uniqueness, NumPy or pandas for numeric tables.
Practice question
Want more like this? The Google Data Analytics practice test has questions for every domain.
Checklist
0 of 14
Tick each one you can do without notes. Your ticks stay in this browser.
Study strategy
Code along with every video in a Jupyter Notebook rather than watching; this course rewards typing. Start with Module 1 and make types second nature: run type() on everything and deliberately trigger a TypeError by adding a string to a number.
In Module 2, write five small functions that return values, then change one to print instead and see what the caller receives. Trace if/elif/else chains on paper with values that meet several conditions. Module 3 holds the most output-prediction traps: write each string's indices under its characters and practice slices, negative indexes and range() until you never miscount.
Module 4 is the longest and most important. Solve one task four ways (list, tuple, dictionary and set) and note which feels natural and why. Then load a small CSV into pandas and repeat a filter and a group summary you did in SQL in Course 5. Afterward, take timed code-reading practice, then move to the capstone, where you can use Python in your case study.
FAQ
Does the Google Data Analytics Certificate teach R or Python?
The current Coursera course list teaches Python in Course 7, Introduction to Data Analysis Using Python, and the program FAQ says R is not covered. Earlier versions taught R, so older guides and some page text still mention it.
Do I need programming experience before Course 7?
No. The course starts from Python's basic building blocks, but expect it to take longer than earlier courses if you have never coded.
How is Course 7 assessed?
The course lists 16 assignments across four modules, and each module ends with a module challenge. Items are mostly code reading: predicting output, spotting bugs and choosing data structures.
Which module is the hardest?
Data structures in Python, listed at about ten hours, because it covers four core structures plus an introduction to NumPy, pandas, data cleaning and binning.
Why are slices and range() so often tested?
Because their rules are precise and easy to get wrong: indexing starts at 0 and the stop value is excluded. One miscount changes the output, which makes a clear multiple-choice item.
How long should I plan for Course 7?
Coursera lists about 27 hours. Our editorial planning estimate is 40 to 50 hours for learners new to coding.
How does Python connect to the earlier courses?
pandas filtering, grouping and cleaning mirror what you did with spreadsheets and SQL in Courses 4 and 5, so Python becomes another way to do the same analysis in reusable code.
Other Data & Analytics certifications
Where the same subject shows up in other exams. Cards marked "Same subject" open the matching domain.
Test your Domain 7 knowledge
You have covered Python types, functions, conditionals, loops, string slicing and data structures. Test whether you can predict code output and choose the right structure under time pressure.
Keep going
- Training Training Built on your Weak areas
- Practice test Questions by domain, with explanations
- Mock exam Full length, timed like the real exam
- Readiness test Find your weakest domain in minutes
- Cheat sheet Key terms and formulas on one page
- Ask the Google Data Analytics AI tutor Get any concept explained your way