Python Inheritance: Parent, Child Classes and super() - Python with AI tutorial chapter 33
Python

Python Inheritance: Parent, Child Classes and super()

Python inheritance lets one class reuse the attributes and methods of another. The existing class is the parent (or base) class, the new one is the child (or derived) class. A child inherits everything from its parent, can add new behaviour and can override methods it wants to change, while super() calls the parent version […]

Python While Loops: break, continue and else - Python with AI tutorial chapter 18
Python

Python While Loops: break, continue and else

A Python while loop repeats a block of code for as long as a condition stays True. Python checks the condition before every pass, so the loop can run zero times, a few times or indefinitely. You control it with break, continue and an optional else clause that runs when the loop finishes normally. Basic […]

Install Python and Set Up VS Code with an AI Assistant - Python with AI tutorial chapter 2
Python

Install Python and Set Up VS Code with an AI Assistant

To install Python you download the official installer from python.org, tick one checkbox so the python command works everywhere, and then add Visual Studio Code with the Python extension as your editor. This chapter walks through both steps on Windows and Mac, runs your first script, and sets up an AI assistant next to your […]

Python Strings: Slicing, Methods and Escape Characters - Python with AI tutorial chapter 9
Python

Python Strings: Slicing, Methods and Escape Characters

Python strings are sequences of characters wrapped in single, double or triple quotes. You use them for names, invoice numbers, email addresses, file paths and every piece of text your program touches. In this chapter you will learn how to create Python strings, slice them, clean them with built-in methods and handle escape characters such […]

Python Modules and pip: Import, Install and Virtual Environments - Python with AI tutorial chapter 25
Python

Python Modules and pip: Import, Install and Virtual Environments

Python modules and pip are how you stop writing everything yourself. A module is any .py file (or built-in library) whose functions you pull in with import; pip is the installer that downloads third-party packages from PyPI. Add a virtual environment and every project keeps its own clean set of packages. Up to now every […]

Python If...Else: Conditions, elif and Nested If - Python with AI tutorial chapter 17
Python

Python If…Else: Conditions, elif and Nested If

A Python if else statement lets your program make decisions. Python evaluates a condition, runs one block of code when it is True and a different block when it is False. With elif you can test several conditions in order, and by nesting one if inside another you can model more detailed business rules. The […]

Python Introduction: What Is Python and Why Learn It - Python with AI tutorial chapter 1
Python

Python Introduction: What Is Python and Why Learn It

This Python introduction explains what Python is, what people build with it and why it is the most useful first programming language for anyone who works with data, spreadsheets or reports. Python is a free, readable, general-purpose language, and in this course you will learn it side by side with an AI assistant that explains […]