Exercise

Using %timeit: formal name or literal syntax

Python allows you to create data structures using either a formal name or a literal syntax. In this exercise, you'll explore how using a literal syntax for creating a data structure can speed up runtimes.

data structure formal name literal syntax
list list() []
dictionary dict() {}
tuple tuple() ()

Instructions 1/3

undefined XP
    1
    2
    3
  • Create an empty list called formal_list using the formal name (list()).
  • Create an empty list called literal_list using the literal syntax ([]).