Python Lessons

A collection of free, in-depth Python lessons for beginners on core topics.

The Basics of Python Syntax

Welcome to the first lesson of this Python Fundamentals course. This lesson is designed to lay the groundwork by briefly introducing you to the core concepts of Python programming. While subsequent lessons will explore these topics in greater detail, this introduction plays an important role in your learning journey.

The Basics of Python Classes and Objects

Object-oriented programming (OOP), which is a programming paradigm that groups code and the data it uses together, is a key feature in Python. The topic of OOP concepts and techniques alone can be covered by a full course in its own right. Since this course is more focused on Python features, this lesson will only cover the basics of how OOP is done in Python, specifically focusing on Python classes and objects.

The Python Walrus Operator

The Python walrus operator := assigns a value to a variable. But unlike assignment operator =, it also returns the assigned value. This extra feature makes it into an expression, which is a construct that produces a value. It allows the walrus operator to be used in contexts where an assignment and a value are both needed, such as within a conditional statement, loops and comprehensions.

The Python ‘in’ Operator

The Python in operator checks for the inclusion of an item within a collection object. It returns True if the item is included and False otherwise. The in operator is versatile and can be used with many data types such as strings, lists, tuples, dictionaries, and sets.

The Python None Value

In Python, None is a special constant that represents the absence of a value or a null value. It is an object of its own data type, the NoneType, and it is not equivalent to any other value or data type.