Python289 exercises

Python Exercises with Answers

Practise Python with 289 interactive exercises: multiple choice, fill-in-the-blank, output prediction and debugging. Every exercise gives instant feedback, a hint and the full solution.

Score0/ 289

1Introduction

Read the lesson
Fill in the blankseasyIntroduction

Complete the line so it shows the text Python is fun on screen.

("Python is fun")
Predict the outputeasyIntroduction

What does this program print?

print("Score:", 4 * 5)
Multiple choiceeasyIntroduction

Which line is a comment in Python?

Predict the outputmediumIntroduction

What does this print?

print(17 // 5, 17 % 5)
Predict the outputmediumIntroduction

What does this print?

print("Total:", 2 + 3)

2Syntax and Statements

Read the lesson
Multiple choiceeasySyntax and Statements

What defines a Python statement block?

Multiple choicemediumSyntax and Statements

Which review concern is valid for syntax and statements?

Multiple choiceeasyComments

What does # inside quoted text represent?

Multiple choicemediumComments

Which review concern is valid for comments?

4The print() Function

Read the lesson
Multiple choiceeasyThe print() Function

Which keyword changes the text between printed arguments?

Multiple choicemediumThe print() Function

Which review concern is valid for the print() function?

5Variables & Data Types

Read the lesson
Fill in the blankseasyVariables & Data Types

Complete the code so it prints Hi, Sam!.

name = "Sam"
print("Hi, {}!")
Predict the outputeasyVariables & Data Types

What does this print?

x = 5
x = x * 2
x += 1
print(x)
Multiple choicemediumVariables & Data Types

Which value is a string?

Predict the outputmediumVariables & Data Types

The user types 7. What does this print?

n = input("Number: ")
print(n * 3)
Multiple choicemediumVariables & Data Types

Which variable name is valid in Python?

6Naming and Multiple Assignment

Read the lesson

What does a = b = [] create?

Multiple choicemediumNaming and Multiple Assignment

Which review concern is valid for naming and multiple assignment?

7Numbers & Math

Read the lesson
Fill in the blankseasyNumbers & Math

Complete the code so it prints the remainder when 17 is divided by 5.

print(17  5)
Predict the outputeasyNumbers & Math

What does this print?

print(9 / 3, 9 // 2)
Predict the outputmediumNumbers & Math

What does this print?

x = 4
x += 2
x *= 3
print(x)
Multiple choicemediumNumbers & Math

Which expression equals 20?

Multiple choicehardNumbers & Math

You need enough buses for 130 people, 50 per bus. Which gives the right answer?

8Type Casting

Read the lesson
Multiple choiceeasyType Casting

What does int(-3.8) produce?

Multiple choicemediumType Casting

Which review concern is valid for type casting?

9The None Value

Read the lesson
Multiple choiceeasyThe None Value

Which test specifically checks for None?

Multiple choicemediumThe None Value

Which review concern is valid for the none value?

Fill in the blankseasyStrings

Complete the code so it prints HELLO.

word = "hello"
print(word.())
Predict the outputeasyStrings

What does this print?

s = "Python"
print(s[1:4])
Predict the outputmediumStrings

What does this print?

tags = "html, css,  js"
print([t.strip() for t in tags.split(",")])
Fill in the blanksmediumStrings

Complete the code so it prints a-b-c.

letters = ["a", "b", "c"]
print("".(letters))
Multiple choicemediumStrings

What does "banana".find("x") return?

11String Formatting

Read the lesson
Fill in the blankseasyString Formatting

Complete the f-string so the price shows exactly two decimal places.

price = 3.5
print(f"£{price:}")
Predict the outputeasyString Formatting

What does this print?

n = 1500000
print(f"{n:,}")
Predict the outputmediumString Formatting

What does this print?

print(f"[{'ok':>5}]")
Multiple choicemediumString Formatting

Which f-string shows 0.4 as 40.0%?

Predict the outputhardString Formatting

What does this print?

x = 3
print(f"{x**2=}")

12User Input with input()

Read the lesson
Multiple choiceeasyUser Input with input()

Which type does input return?

Multiple choicemediumUser Input with input()

Which review concern is valid for user input with input()?

13Boolean Values and Expressions

Read the lesson

What is bool("0")?

Multiple choicemediumBoolean Values and Expressions

Which review concern is valid for boolean values and expressions?

14Operators and Precedence

Read the lesson
Multiple choiceeasyOperators and Precedence

What does 2 + 3 * 4 evaluate to?

Multiple choicemediumOperators and Precedence

Which review concern is valid for operators and precedence?

15if / elif / else

Read the lesson
Fill in the blankseasyif / elif / else

Complete the code so it prints "Too cold" when temp is below 10, and "OK" otherwise.

temp = 4
 temp < 10:
    print("Too cold")
:
    print("OK")
Predict the outputeasyif / elif / else

What does this print?

x = 10
if x > 5:
    print("big")
elif x > 8:
    print("bigger")
else:
    print("small")
Multiple choicemediumif / elif / else

Which condition is True when age is between 13 and 19, inclusive?

Predict the outputmediumif / elif / else

What does this print?

logged_in = False
is_admin = True

if logged_in and is_admin:
    print("Admin panel")
elif not logged_in:
    print("Please log in")
else:
    print("Welcome")
Predict the outputhardif / elif / else

What does this print?

age = 15
if age >= 18:
    print("adult")
elif age >= 13:
    print("teen")
elif age >= 5:
    print("child")

16The match Statement

Read the lesson
Multiple choiceeasyThe match Statement

What does a bare name normally do in a match pattern?

Multiple choicemediumThe match Statement

Which review concern is valid for the match statement?

17The pass Statement

Read the lesson
Multiple choiceeasyThe pass Statement

Does pass skip the rest of a loop iteration?

Multiple choicemediumThe pass Statement

Which review concern is valid for the pass statement?

18Loops (for & while)

Read the lesson
Fill in the blankseasyLoops (for & while)

Complete the loop so it prints the numbers 0 to 4.

 i  range(5):
    print(i)
Predict the outputeasyLoops (for & while)

What numbers does this print?

for i in range(2, 9, 3):
    print(i)
Predict the outputmediumLoops (for & while)

What does this print?

n = 1
while n < 20:
    n = n * 3
print(n)
Multiple choicemediumLoops (for & while)

Which keyword skips the rest of the current pass and moves to the next one?

Predict the outputmediumLoops (for & while)

What does this print?

total = 0
for n in range(1, 5):
    total += n
print(total)
Fill in the blankseasyLists

Complete the code so "pear" is added to the end of the list.

fruit = ["apple", "plum"]
fruit.("pear")
print(fruit)
Predict the outputeasyLists

What does this print?

letters = ["a", "b", "c", "d"]
print(letters[1], letters[-1])
Predict the outputmediumLists

What does this print?

nums = [10, 20, 30, 40, 50]
print(nums[1:4])
Multiple choicemediumLists

Which line removes and returns the last item of a list called stack?

Predict the outputmediumLists

What does this print?

nums = [4, 8, 15, 16, 23]
print(nums[1:3], nums[-1])

20Dictionaries

Read the lesson
Fill in the blankseasyDictionaries

Complete the code so it prints Lisbon.

capitals = {"Portugal": "Lisbon", "Spain": "Madrid"}
print(capitals[""])
Predict the outputeasyDictionaries

What does this print?

d = {"a": 1, "b": 2}
d["a"] = 10
d["c"] = 3
print(len(d), d["a"])
Predict the outputmediumDictionaries

What does this print?

stock = {"pens": 12}
print(stock.get("pencils", 0) + stock.get("pens", 0))
Multiple choicemediumDictionaries

Which loop gives you both the key and the value?

Predict the outputhardDictionaries

What does this print?

d = {"x": 1, "x": 2}
print(d)

21Tuples & Sets

Read the lesson
Fill in the blankseasyTuples & Sets

Complete the code so it unpacks the tuple into two variables.

size = (1920, 1080)
, height = size
Predict the outputeasyTuples & Sets

What does this print?

nums = {4, 2, 4, 2, 4}
print(len(nums))
Predict the outputmediumTuples & Sets

What does this print?

a = {1, 2, 3, 4}
b = {3, 4, 5}
print(sorted(a - b), sorted(a & b))
Multiple choicemediumTuples & Sets

Which line creates an empty set?

Multiple choicehardTuples & Sets

Which collection best stores a GPS position that must never be edited?

22range() in Depth

Read the lesson
Multiple choiceeasyrange() in Depth

Which boundary is excluded by range?

Multiple choicemediumrange() in Depth

Which review concern is valid for range() in depth?

23Arrays in Python

Read the lesson
Multiple choiceeasyArrays in Python

What restricts values in array.array?

Multiple choicemediumArrays in Python

Which review concern is valid for arrays in python?

24Advanced Collection Methods

Read the lesson
Multiple choiceeasyAdvanced Collection Methods

Which operation finds shared set members?

Multiple choicemediumAdvanced Collection Methods

Which review concern is valid for advanced collection methods?

25Copying and Joining Collections

Read the lesson

What stays shared after a shallow copy?

Multiple choicemediumCopying and Joining Collections

Which review concern is valid for copying and joining collections?

26Functions

Read the lesson
Fill in the blankseasyFunctions

Complete the function so it returns double the number it's given.

 double(n):
     n * 2
Predict the outputeasyFunctions

What does this print?

def add(a, b=10):
    return a + b

print(add(5), add(5, 1))
Predict the outputmediumFunctions

What does this print?

def shout(word):
    print(word.upper())

result = shout("hey")
print(result)
Multiple choicemediumFunctions

Which definition is valid?

Multiple choicehardFunctions

What does this function return when called as check(-2)?

def check(n):
    if n > 0:
        return "positive"

27Arguments & Scope

Read the lesson
Fill in the blankseasyArguments & Scope

Complete the definition so the function accepts any number of names.

def greet_all(names):
    for name in names:
        print("Hi", name)
Predict the outputeasyArguments & Scope

What does this print?

def count(*things):
    return len(things)

print(count("a", "b", "c"))
Predict the outputmediumArguments & Scope

What does this print?

def show(**info):
    print(sorted(info))

show(b=2, a=1)
Multiple choicemediumArguments & Scope

Given def book(room, *, nights):, which call works?

Predict the outputhardArguments & Scope

What does this print?

def f(x, items=[]):
    items.append(x)
    return len(items)

f(1)
print(f(2))

28Recursion

Read the lesson
Multiple choiceeasyRecursion

What terminates recursive descent?

Multiple choicemediumRecursion

Which review concern is valid for recursion?

29Comprehensions & Lambda

Read the lesson
Fill in the blankseasyComprehensions & Lambda

Complete the comprehension so it builds a list of the numbers doubled.

nums = [1, 2, 3]
doubled = [n * 2  n  nums]
Predict the outputeasyComprehensions & Lambda

What does this print?

print([len(w) for w in ["hi", "hello", "hey"]])
Predict the outputmediumComprehensions & Lambda

What does this print?

print([n for n in range(1, 11) if n % 3 == 0])
Predict the outputmediumComprehensions & Lambda

What does this print?

words = ["bb", "a", "ccc"]
print(sorted(words, key=lambda w: len(w)))
Multiple choicehardComprehensions & Lambda

Which line builds the dictionary {'a': 'A', 'b': 'B'}?

30Errors & Exceptions

Read the lesson
Fill in the blankseasyErrors & Exceptions

Complete the code so a bad number is handled instead of crashing.

:
    n = int("abc")
 ValueError:
    print("Not a number")
Predict the outputeasyErrors & Exceptions

What does this print?

try:
    print(10 / 0)
except ZeroDivisionError:
    print("Oops")
Predict the outputmediumErrors & Exceptions

What does this print?

try:
    x = int("7")
except ValueError:
    print("A")
else:
    print("B")
finally:
    print("C")
Multiple choicemediumErrors & Exceptions

Which exception does {"a": 1}["b"] raise?

Multiple choicehardErrors & Exceptions

Why is except: with no exception type usually a bad idea?

31Files (Text, CSV, JSON)

Read the lesson
Fill in the blankseasyFiles (Text, CSV, JSON)

Complete the code so the file is closed automatically.

 open("notes.txt", encoding="utf-8")  f:
    print(f.read())
Multiple choiceeasyFiles (Text, CSV, JSON)

Which mode adds text to the end of a file without deleting what's there?

Predict the outputmediumFiles (Text, CSV, JSON)

A file contains the two lines hi and there. What does this print?

with open("f.txt", encoding="utf-8") as f:
    print(f.readlines())
Multiple choicemediumFiles (Text, CSV, JSON)

Which function saves a Python dictionary to a file as JSON?

Multiple choicehardFiles (Text, CSV, JSON)

Why is csv.DictReader handy?

32Modules, pip & venv

Read the lesson
Fill in the blankseasyModules, pip & venv

Complete the line so randint can be used directly.

 random  randint
print(randint(1, 10))
Multiple choiceeasyModules, pip & venv

Which command installs a package from PyPI?

Predict the outputmediumModules, pip & venv

What does this print?

import math
print(math.ceil(4.1), math.floor(4.9))
Multiple choicemediumModules, pip & venv

What does if __name__ == "__main__": do?

Multiple choicehardModules, pip & venv

Why use a virtual environment for each project?

33Dates & Times

Read the lesson
Fill in the blankseasyDates & Times

Complete the code so it prints today's date.

from datetime import date
print(date.())
Predict the outputeasyDates & Times

What does this print?

from datetime import date
d = date(2025, 7, 4)
print(d.strftime("%d/%m/%Y"))
Predict the outputmediumDates & Times

What does this print?

from datetime import date
print((date(2025, 3, 10) - date(2025, 2, 28)).days)
Multiple choicemediumDates & Times

Which call reads "31-01-2025" into a datetime?

Multiple choicehardDates & Times

Why store times in UTC?

34Classes & Objects

Read the lesson
Fill in the blankseasyClasses & Objects

Complete the class so each object stores its title.

class Book:
    def (self, title):
        .title = title
Predict the outputeasyClasses & Objects

What does this print?

class Cat:
    def __init__(self, name):
        self.name = name

a = Cat("Tom")
b = Cat("Kit")
print(b.name)
Predict the outputmediumClasses & Objects

What does this print?

class Counter:
    def __init__(self):
        self.count = 0
    def click(self):
        self.count += 1
        return self

c = Counter()
c.click().click().click()
print(c.count)
Multiple choicemediumClasses & Objects

What is self in a method?

Multiple choicehardClasses & Objects

Which method controls what print(obj) shows?

35Inheritance

Read the lesson
Fill in the blankseasyInheritance

Complete the line so Truck inherits from Vehicle.

class Truck():
    pass
Fill in the blanksmediumInheritance

Complete the constructor so the parent sets up the name first.

class Student(Person):
    def __init__(self, name, school):
        ().__init__(name)
        self.school = school
Predict the outputmediumInheritance

What does this print?

class A:
    def hello(self):
        return "A"

class B(A):
    def hello(self):
        return "B" + super().hello()

print(B().hello())
Predict the outputmediumInheritance

What does this print?

class Shape: pass
class Square(Shape): pass

print(isinstance(Square(), Shape), isinstance(Shape(), Square))
Multiple choicehardInheritance

A Library contains many Book objects. How should you model it?

36Python Magic Methods

Read the lesson
Multiple choiceeasyPython Magic Methods

Which method is intended for diagnostic representation?

Multiple choicemediumPython Magic Methods

Which review concern is valid for Python magic methods?

37Class Methods and Properties

Read the lesson
Multiple choiceeasyClass Methods and Properties

Why store _capacity in the property setter?

Multiple choicemediumClass Methods and Properties

Which review concern is valid for class methods and properties?

38Polymorphism and Inner Classes

Read the lesson

Does a nested class automatically receive an outer instance?

Multiple choicemediumPolymorphism and Inner Classes

Which review concern is valid for polymorphism and inner classes?

39Type Hints & Dataclasses

Read the lesson
Fill in the blankseasyType Hints & Dataclasses

Complete the hint so the function is marked as returning a string.

def initials(name: str)  str:
    return name[0]
Multiple choiceeasyType Hints & Dataclasses

What does the hint list[int] mean?

Predict the outputmediumType Hints & Dataclasses

What does this print?

from dataclasses import dataclass

@dataclass
class Point:
    x: int
    y: int = 0

print(Point(3))
Multiple choicemediumType Hints & Dataclasses

Which hint means "a string or nothing"?

Multiple choicehardType Hints & Dataclasses

Why does @dataclass(frozen=True) let objects be used as dictionary keys?

40Iterators & Generators

Read the lesson
Fill in the blankseasyIterators & Generators

Complete the generator so it produces the numbers 1, 2 and 3.

def one_two_three():
    for n in [1, 2, 3]:
         n
Predict the outputeasyIterators & Generators

What does this print?

it = iter("hi")
print(next(it), next(it))
Predict the outputmediumIterators & Generators

What does this print?

def gen():
    yield 1
    yield 2

g = gen()
print(list(g), list(g))
Multiple choicemediumIterators & Generators

Which creates a generator expression?

Multiple choicehardIterators & Generators

Why is a generator good for a 20 GB log file?

41Iterators vs. Iterables

Read the lesson
Multiple choiceeasyIterators vs. Iterables

What happens to an exhausted iterator in a for loop?

Multiple choicemediumIterators vs. Iterables

Which review concern is valid for iterators vs. iterables?

42Context Managers

Read the lesson
Multiple choiceeasyContext Managers

Where should essential contextmanager cleanup go?

Multiple choicemediumContext Managers

Which review concern is valid for context managers?

43Decorators

Read the lesson
Fill in the blankseasyDecorators

Complete the line that applies the timed decorator to the function.

timed
def build_report():
    ...
Multiple choiceeasyDecorators

What is @shout above def hello(): shorthand for?

Predict the outputmediumDecorators

What does this print?

def twice(func):
    def wrapper():
        func()
        func()
    return wrapper

@twice
def hi():
    print("hi")

hi()
Multiple choicemediumDecorators

Why does a wrapper use *args, **kwargs?

Multiple choicehardDecorators

What does @functools.wraps(func) do?

44Regular Expressions

Read the lesson
Fill in the blankseasyRegular Expressions

Complete the pattern so it finds all whole numbers in the text.

re.findall(r"\d", "3 cats and 12 dogs")
Predict the outputeasyRegular Expressions

What does this print?

import re
print(re.findall(r"[aeiou]", "regex"))
Predict the outputmediumRegular Expressions

What does this print?

import re
print(re.sub(r"\d", "#", "PIN 4821"))
Multiple choicemediumRegular Expressions

Which pattern matches exactly a UK-style time like 09:45?

Multiple choicehardRegular Expressions

Why use re.fullmatch for validation instead of re.search?

Fill in the blankseasyTesting

Complete the test so it checks that add(2, 3) returns 5.

def test_add():
     add(2, 3) == 5
Multiple choiceeasyTesting

Which file name will pytest discover automatically?

Multiple choicemediumTesting

How do you test that a function raises ValueError?

Predict the outputmediumTesting

A parametrized test has 4 sets of values. How many results does pytest report for it?

Multiple choicehardTesting

Where do bugs most often hide, and so where should test cases focus?

46Web APIs & requests

Read the lesson
Fill in the blankseasyWeb APIs & requests

Complete the line so the JSON response is converted into Python objects.

data = response.()
Multiple choiceeasyWeb APIs & requests

Which status code means "not found"?

Multiple choicemediumWeb APIs & requests

What does params={"q": "cats"} do in requests.get?

Predict the outputmediumWeb APIs & requests

r.status_code is 500 and you call r.raise_for_status(). What happens?

Multiple choicehardWeb APIs & requests

Where should an API key live?

47Read, Write, Create and Delete Files

Read the lesson

Which mode refuses to overwrite an existing file?

Which review concern is valid for read, write, create and delete files?

48JSON Handling

Read the lesson
Multiple choiceeasyJSON Handling

Which function decodes JSON from a string?

Multiple choicemediumJSON Handling

Which review concern is valid for json handling?

49CSV Handling in Depth

Read the lesson
Multiple choiceeasyCSV Handling in Depth

What type is a numeric field returned by DictReader?

Multiple choicemediumCSV Handling in Depth

Which review concern is valid for csv handling in depth?

50File and Directory Operations

Read the lesson

Does creating a Path object create a filesystem entry?

Multiple choicemediumFile and Directory Operations

Which review concern is valid for file and directory operations?

51Built-in Functions Reference

Read the lesson
Multiple choiceeasyBuilt-in Functions Reference

What does ordinary zip do with unequal iterable lengths?

Multiple choicemediumBuilt-in Functions Reference

Which review concern is valid for built-in functions reference?

52String and Collection Methods Reference

Read the lesson

Which method changes a list in place?

Which review concern is valid for string and collection methods reference?

53Exception Types Reference

Read the lesson
Multiple choiceeasyException Types Reference

Which exception normally describes invalid integer text?

Multiple choicemediumException Types Reference

Which review concern is valid for exception types reference?

54Python Keywords and Glossary

Read the lesson
Multiple choiceeasyPython Keywords and Glossary

Is print normally a reserved Python keyword?

Multiple choicemediumPython Keywords and Glossary

Which review concern is valid for Python keywords and glossary?

55Standard Library Essentials

Read the lesson
Multiple choiceeasyStandard Library Essentials

Which standard library type counts repeated values?

Multiple choicemediumStandard Library Essentials

Which review concern is valid for standard library essentials?

56Environment Variables and Configuration

Read the lesson

What type does os.getenv return when it finds a value?

Which review concern is valid for environment variables and configuration?

57pip and Virtual Environments

Read the lesson
Multiple choiceeasypip and Virtual Environments

Which form selects pip for a chosen Python interpreter?

Multiple choicemediumpip and Virtual Environments

Which review concern is valid for pip and virtual environments?

58Debugging Python Programs

Read the lesson
Multiple choiceeasyDebugging Python Programs

What makes a useful debugging hypothesis?

Multiple choicemediumDebugging Python Programs

Which review concern is valid for debugging python programs?

Multiple choiceeasyLogging

Where does logger.exception normally capture exception context?

Multiple choicemediumLogging

Which review concern is valid for logging?

60Unit Testing and pytest

Read the lesson
Multiple choiceeasyUnit Testing and pytest

Why test an exact capacity boundary?

Multiple choicemediumUnit Testing and pytest

Which review concern is valid for unit testing and pytest?

61Mocking and Test Fixtures

Read the lesson
Multiple choiceeasyMocking and Test Fixtures

Where should a dependency usually be patched?

Multiple choicemediumMocking and Test Fixtures

Which review concern is valid for mocking and test fixtures?

62Code Style and PEP 8

Read the lesson
Multiple choiceeasyCode Style and PEP 8

Which style commonly names Python functions?

Multiple choicemediumCode Style and PEP 8

Which review concern is valid for code style and pep 8?

63Type Checking and Type Hinting

Read the lesson

Do annotations alone enforce parameter types at runtime?

Multiple choicemediumType Checking and Type Hinting

Which review concern is valid for type checking and type hinting?

64Virtual Environments and Dependencies

Read the lesson

What does a loose version constraint guarantee?

Which review concern is valid for virtual environments and dependencies?

65Git and Python Projects

Read the lesson
Multiple choiceeasyGit and Python Projects

Should a project normally commit its .venv directory?

Multiple choicemediumGit and Python Projects

Which review concern is valid for git and python projects?

66Interview Questions and Answers

Read the lesson

Why did editing second also change first?

Multiple choicemediumInterview Questions and Answers

Which review concern is valid for interview questions and answers?

67Database Connections and Queries

Read the lesson

Does with sqlite3.connect(...) by itself close the connection?

Which review concern is valid for database connections and queries?

68SQL CRUD with Python

Read the lesson
Multiple choiceeasySQL CRUD with Python

Which clause limits rows affected by a simple UPDATE?

Multiple choicemediumSQL CRUD with Python

Which review concern is valid for sql crud with python?

69Python MySQL Tutorial

Read the lesson
Multiple choiceeasyPython MySQL Tutorial

How should a member identifier enter a SQL query?

Multiple choicemediumPython MySQL Tutorial

Which review concern is valid for python mysql tutorial?

70Python MongoDB Tutorial

Read the lesson
Multiple choiceeasyPython MongoDB Tutorial

Which update operator changes selected MongoDB fields?

Multiple choicemediumPython MongoDB Tutorial

Which review concern is valid for python mongodb tutorial?

71HTTP Requests and REST APIs

Read the lesson
Multiple choiceeasyHTTP Requests and REST APIs

Why set a request timeout?

Multiple choicemediumHTTP Requests and REST APIs

Which review concern is valid for http requests and rest apis?

72API Authentication and Errors

Read the lesson

Can a valid token still lack permission for an operation?

Multiple choicemediumAPI Authentication and Errors

Which review concern is valid for api authentication and errors?

73A Simple Python Web Server

Read the lesson
Multiple choiceeasyA Simple Python Web Server

What type is written to the response body stream?

Multiple choicemediumA Simple Python Web Server

Which review concern is valid for a simple python web server?

74Introduction to Flask

Read the lesson
Multiple choiceeasyIntroduction to Flask

Should the Flask development debugger be exposed in production?

Multiple choicemediumIntroduction to Flask

Which review concern is valid for introduction to flask?

75NumPy Tutorial

Read the lesson
Multiple choiceeasyNumPy Tutorial

What does axis=1 sum in a two dimensional array?

Multiple choicemediumNumPy Tutorial

Which review concern is valid for numpy tutorial?

76Pandas Tutorial

Read the lesson
Multiple choiceeasyPandas Tutorial

Which selector uses integer positions?

Multiple choicemediumPandas Tutorial

Which review concern is valid for pandas tutorial?

77Matplotlib Tutorial

Read the lesson
Multiple choiceeasyMatplotlib Tutorial

Which object represents an individual plotting area?

Multiple choicemediumMatplotlib Tutorial

Which review concern is valid for matplotlib tutorial?

78Data Cleaning and Analysis

Read the lesson
Multiple choiceeasyData Cleaning and Analysis

Why retain rejected row information?

Multiple choicemediumData Cleaning and Analysis

Which review concern is valid for data cleaning and analysis?

79Statistics with Python

Read the lesson
Multiple choiceeasyStatistics with Python

Which statistic is generally less affected by one extreme duration?

Multiple choicemediumStatistics with Python

Which review concern is valid for statistics with python?

80Line, Bar, Scatter and Histogram Charts

Read the lesson

Which chart shows the distribution of one numeric variable?

Which review concern is valid for line, bar, scatter and histogram charts?

81Time and Space Complexity

Read the lesson
Multiple choiceeasyTime and Space Complexity

What is the worst case growth of a full list scan?

Multiple choicemediumTime and Space Complexity

Which review concern is valid for time and space complexity?

82Linear and Binary Search

Read the lesson
Multiple choiceeasyLinear and Binary Search

What prerequisite does binary search require?

Multiple choicemediumLinear and Binary Search

Which review concern is valid for linear and binary search?

83Sorting Algorithms

Read the lesson
Multiple choiceeasySorting Algorithms

What does a stable sort preserve for equal keys?

Multiple choicemediumSorting Algorithms

Which review concern is valid for sorting algorithms?

84Stacks and Queues

Read the lesson
Multiple choiceeasyStacks and Queues

Which order describes a queue?

Multiple choicemediumStacks and Queues

Which review concern is valid for stacks and queues?

85Linked Lists

Read the lesson
Multiple choiceeasyLinked Lists

How does a singly linked list reach the next value?

Multiple choicemediumLinked Lists

Which review concern is valid for linked lists?

86Hash Tables

Read the lesson
Multiple choiceeasyHash Tables

Can different dictionary keys have the same hash?

Multiple choicemediumHash Tables

Which review concern is valid for hash tables?

87Trees and Binary Search Trees

Read the lesson

What determines search cost in a simple BST?

Multiple choicemediumTrees and Binary Search Trees

Which review concern is valid for trees and binary search trees?

88Graphs and Graph Traversal

Read the lesson
Multiple choiceeasyGraphs and Graph Traversal

Which traversal finds shortest hop counts in an unweighted graph?

Multiple choicemediumGraphs and Graph Traversal

Which review concern is valid for graphs and graph traversal?

89Recursive Problem Solving

Read the lesson
Multiple choiceeasyRecursive Problem Solving

What must mutable backtracking restore?

Multiple choicemediumRecursive Problem Solving

Which review concern is valid for recursive problem solving?

90Introduction to Machine Learning

Read the lesson

Why compare a learned model with a baseline?

Which review concern is valid for introduction to machine learning?

91Mean, Median, Mode and Deviation

Read the lesson

What does multimode help represent?

Which review concern is valid for mean, median, mode and deviation?

92Data Distribution and Percentiles

Read the lesson

Why can percentile calculations differ between tools?

Which review concern is valid for data distribution and percentiles?

93Linear and Multiple Regression

Read the lesson

What kind of target does ordinary linear regression predict?

Multiple choicemediumLinear and Multiple Regression

Which review concern is valid for linear and multiple regression?

94Logistic Regression

Read the lesson
Multiple choiceeasyLogistic Regression

What does predict_proba provide?

Multiple choicemediumLogistic Regression

Which review concern is valid for logistic regression?

95Decision Trees and K-Nearest Neighbors

Read the lesson

Why scale mixed KNN features?

Which review concern is valid for decision trees and k-nearest neighbors?

96Training and Testing Datasets

Read the lesson

Which observations should fit a preprocessing transformation?

Multiple choicemediumTraining and Testing Datasets

Which review concern is valid for training and testing datasets?

97Cross-Validation and Evaluation

Read the lesson

Why include preprocessing inside the cross validation pipeline?

Multiple choicemediumCross-Validation and Evaluation

Which review concern is valid for cross-validation and evaluation?

98Clustering and K-Means

Read the lesson
Multiple choiceeasyClustering and K-Means

Do K-means cluster labels have inherent category meanings?

Multiple choicemediumClustering and K-Means

Which review concern is valid for clustering and k-means?

99Python Examples Library

Read the lesson
Multiple choiceeasyPython Examples Library

What should you identify before adapting an example?

Multiple choicemediumPython Examples Library

Which review concern is valid for Python examples library?

100Python Coding Challenges

Read the lesson
Multiple choiceeasyPython Coding Challenges

What should a challenge include besides an ordinary example?

Multiple choicemediumPython Coding Challenges

Which review concern is valid for Python coding challenges?

101Python Practice Problems

Read the lesson
Multiple choiceeasyPython Practice Problems

Why attempt a problem before reading its solution?

Multiple choicemediumPython Practice Problems

Which review concern is valid for Python practice problems?

102Python Exercises by Difficulty

Read the lesson

What makes an advanced exercise valuable?

Multiple choicemediumPython Exercises by Difficulty

Which review concern is valid for python exercises by difficulty?

103Python Quizzes by Chapter

Read the lesson
Multiple choiceeasyPython Quizzes by Chapter

How should a missed quiz question guide study?

Multiple choicemediumPython Quizzes by Chapter

Which review concern is valid for Python quizzes by chapter?

104Beginner Python Projects

Read the lesson
Multiple choiceeasyBeginner Python Projects

What should the first project milestone provide?

Multiple choicemediumBeginner Python Projects

Which review concern is valid for beginner python projects?

105Intermediate Python Projects

Read the lesson
Multiple choiceeasyIntermediate Python Projects

Which responsibility should be separated from stock arithmetic?

Multiple choicemediumIntermediate Python Projects

Which review concern is valid for intermediate python projects?

106Advanced Python Projects

Read the lesson
Multiple choiceeasyAdvanced Python Projects

Do adjacent half open booking intervals overlap?

Multiple choicemediumAdvanced Python Projects

Which review concern is valid for advanced python projects?

107Study Plan and Learning Roadmap

Read the lesson

When should the separate machine learning track be approached?

Multiple choicemediumStudy Plan and Learning Roadmap

Which review concern is valid for study plan and learning roadmap?

Next steps