Python Data Types and Structures
Data types, lists, and dictionaries.
Python Data Types and Structures is a free Python Academy lesson on CoddyKit. This is lesson 2 of 5. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Python Academy learning path, and your progress syncs across the web and the CoddyKit app. The Python Academy course includes 5 lessons in total.
Python's Core Data Types
Python Data Types and Structures
Python provides various data types and structures to store and manipulate data effectively. In this lesson, we’ll explore fundamental data types like integers, floats, and strings, as well as data structures like lists and dictionaries.

Basic Data Types
Python has several basic data types:
- Integer: Whole numbers (e.g.,
10). - Float: Numbers with decimals (e.g.,
3.14). - String: Text enclosed in quotes (e.g.,
'Hello').
Lists
A list is a collection of items in a specific order. Lists are defined using square brackets ([]) and can hold any data type.
Example:
my_list = [1, 2, 3, 'apple', 'banana']Accessing List Elements
You can access elements in a list using their index. Indexing starts at 0 in Python.
Example:
my_list[0] returns 1 from the list [1, 2, 3].Dictionaries
A dictionary stores data in key-value pairs. It’s defined using curly braces ({}).
Example:
my_dict = {'name': 'Alice', 'age': 25}Accessing Dictionary Values
You can access a value in a dictionary using its key.
Example:
my_dict['name'] returns 'Alice' from the dictionary {'name': 'Alice', 'age': 25}.Combining Lists and Dictionaries
You can nest lists inside dictionaries or dictionaries inside lists for more complex data structures.
Example:
my_data = {'fruits': ['apple', 'banana'], 'vegetables': ['carrot', 'spinach']}Recap
You’ve learned about basic Python data types and structures:
- Integers: For whole numbers.
- Strings: For text.
- Lists: Ordered collections of items.
- Dictionaries: Key-value pairs for structured data.
Congratulations!
You’ve completed the lesson on Python Data Types and Structures. Continue to the next lesson to learn about file operations in Python.

Learn Python with an AI tutor — free
Write and run real code in your browser, get instant help from a 24/7 AI tutor, and pick up where you left off on the web or in the app.
- Courses
- 76
- Lessons
- 320
Frequently Asked Questions
Is the “Python Data Types and Structures” lesson free?
Yes — the full text of “Python Data Types and Structures” is free to read here on the web. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Python Academy course, upgrade to CoddyKit PRO. The Python Academy course includes 5 lessons in total.
What will I learn in “Python Data Types and Structures”?
Data types, lists, and dictionaries. You practise Python Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Python Academy?
No prior experience is required. Python Academy on CoddyKit is structured for beginners through advanced learners, so you can start here or from the beginning and move at your own pace. This is lesson 2 of 5.
How long does the “Python Data Types and Structures” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Python Academy lesson?
Yes. Every Python Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Python Libraries for AI
- Python Data Types and Structures
- File Operations in Python
- Error Handling in Python
- Setting Up the Development Environment