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.

The Python ‘is’ Operator

The Python is operator determines whether two references (variables or literals) point to the same object in memory, i.e. whether they are the same object. The is operator is different from the equality operator ==, which checks whether the values of potentially two objects are equal.

Python Type Conversion

Type conversion in Python refers to the process of converting a value from one data type to another. This is a common task when writing code. It allows for more flexibility in how data is processed and ensures that operations between different types of data are error-free. Python performs some type conversions automatically, and also provides several built-in functions to convert between different data types.

Python Booleans

A Boolean is a data type that has either one of two values representing a conceptual "true" or "false". Booleans are named after the mathematician George Boole, who was a pioneer of mathematical logic. In programming, they are used for decision-making, (i.e. to determine whether the computer should do something or not.

Python Numbers

Numbers are a fundamental aspect of computer programming. Python provides robust support for numeric operations and data types. This lesson covers the three built-in numeric types available in Python: integers, floating-point numbers, and complex numbers.

Python Strings

A Python string is a sequence of text characters. Strings are among the most commonly used data types in Python, and essential for handling text data. Python strings are easy to use and in many ways, work like other Python collections data structures, such as lists and tuples, do. They can be considered ordered collections of individual characters.

Python Variables

Variables are a fundamental part of any programming language. They provide a way to store, access, and remember data for later use. You can think of variables as containers that store basic information of various types, such as numbers and text, or complex data structures that are composed of combinations of those.

Python Context Managers

Python context managers provide a convenient way to manage resources, such as files, network connections, and locks. They enable automatic setup and teardown operations, saving development effort, simplifying code, minimizing errors. Context managers further ensure that resources are properly managed even in the presence of exceptions or errors.

Python Class Decorators

Python class decorators extend the functionality of classes in a manner similar to how function decorators extend functions. They allow you to modify or enhance the behavior of classes without directly altering their source code. Class decorators are particularly useful for adding features like validation, caching, or logging to classes in a flexible and reusable way.