Python Basics
15 lessons · Beginner friendly
Installing Python and Setting Up Your Environment
Download and install Python on Windows, macOS, or Linux, and write your very first Python program.
Your First Python Program
Learn how to write and run a Python script file, understand what print() does, and add comments to your code.
Variables and Assignment
Learn what variables are, how to create them, and how to use them to store and reuse information in your programs.
Data Types: int, float, str, bool
Learn about the four most common Python data types — integers, floats, strings, and booleans — and how to check what type a value is.
String Operations and Methods
Learn how to slice strings, check their length, search for text, change case, and use the most useful string methods.
Getting User Input
Learn how to use the input() function to ask users for information and use their answers in your programs.
if / elif / else Statements
Learn how to make decisions in Python using if, elif, and else to run different code depending on conditions.
for Loops
Learn how to repeat actions automatically using for loops, range(), and how to loop over lists and strings.
while Loops
Learn how to use while loops to repeat code as long as a condition is true, and how to control loops with break and continue.
Functions
Learn how to write reusable functions, pass arguments, return values, and organize your code into logical building blocks.
Lists
Learn how to store multiple values in a list, access and modify elements, loop over lists, and use the most common list methods.
Dictionaries
Learn how to store and look up data using key-value pairs with Python dictionaries.
Reading and Writing Files
Learn how to save data to text files and read it back, so your programs can remember information between runs.
Handling Errors
Learn how to use try/except to catch errors gracefully, so your programs keep running instead of crashing.
Putting It All Together — Build a Simple CLI App
Apply everything you have learned to build a complete command-line contact book application with file storage.