Creating Lists
Concepts covered: pyListCreate
Every list in Python is defined using square brackets: [ and ]. These brackets tell Python that you are creating a list rather than some other type of data. Inside the brackets, you place the items you want to store, separated by commas. Each comma acts as a divider between individual items. In the first example, we create a list called numbers containing five integers. The square brackets wrap around all five values, and commas separate each value from the next. In the second example, we create a list of three strings. Notice that when Python prints strings, it shows them with quotes to indicate they are text rather than numbers. Empty Lists Sometimes you need to create a list that starts with no items. This is called an empty list. You might do this when you plan to add items later, perh
About This Interactive Section
This section is part of the Lists: Beginner lesson on DataDriven, a free data engineering interview prep platform. Each section includes explanations, worked examples, and hands-on code challenges that execute in real time. SQL queries run against a live PostgreSQL database. Python runs in a sandboxed Docker container. Data modeling problems validate against interactive schema canvases. All content is framed around what data engineering interviewers actually test at companies like Meta, Google, Amazon, Netflix, Stripe, and Databricks.
How DataDriven Lessons Work
DataDriven combines four interview rounds (SQL, Python, Data Modeling, Pipeline Architecture) with adaptive difficulty and spaced repetition. Easy problems get harder as you improve. Weak concepts resurface until you master them. Your readiness score tracks progress across every topic interviewers test. Every lesson section ends with problems you solve by writing and running real code, not by picking multiple-choice answers.