Python tutorials

Quiz: Python Textual: Build Beautiful UIs in the Terminal

Interactive Quiz ⋅ 7 QuestionsBy Leodanis Pozo Ramos Share In this quiz, you’ll test your understanding of the Python Textual library. This library is used for creating text-based interface applications for the terminal. By working through this quiz, you’ll reinforce your knowledge of Textual’s key concepts and features. The quiz contains 7 questions and there is no time limit. You’ll get 1 point for each correct answer. At the end of the quiz, you’ll receive a total score. The maximum […]

Read more

Quiz: What Is the Python Global Interpreter Lock (GIL)?

Interactive Quiz ⋅ 6 QuestionsBy Martin Breuss Share In this quiz, you’ll test your understanding of the Python Global Interpreter Lock (GIL). The GIL allows only one thread to hold the control of the Python interpreter. This has advantages, but can also be a performance bottleneck in CPU-bound and multi-threaded code. By working through this quiz, you’ll revisit the impact of the GIL on the performance of your Python programs and how to mitigate it. The quiz contains 6 questions […]

Read more

Bytes Objects: Handling Binary Data in Python

The bytes data type is an immutable sequence of unsigned bytes used for handling binary data in Python. You can create a bytes object using the literal syntax, the bytes() function, or the bytes.fromhex() method. Since bytes are closely related to strings, you often convert between the two data types, applying the correct character encoding. This tutorial starts with a brief overview of binary data fundamentals, setting the scene for the remaining part, which delves into creating and manipulating bytes […]

Read more

Working With Python Polars

In the world of data analysis and manipulation, Python has long been the go-to language. With extensive and user-friendly libraries like NumPy, pandas, and PySpark, there’s a solution available for almost any data-driven task. Among these libraries, one name that’s been generating a significant amount of buzz lately is Polars. Polars is a high-performance DataFrame library, designed to provide fast and efficient data processing capabilities. Inspired by the reigning pandas library, Polars takes things to another level, offering a seamless […]

Read more

Python while Loops: Repeating Tasks Conditionally

Watch Now This tutorial has a related video course created by the Real Python team. Watch it together with the written tutorial to deepen your understanding: Mastering While Loops Python’s while loop enables you to execute a block of code repeatedly as long as a given condition remains true. Unlike for loops, which iterate a known number of times, while loops are ideal for situations where the number of iterations isn’t known upfront. Loops are a pretty useful construct in […]

Read more

Quiz: Python while Loops: Repeating Tasks Conditionally

Interactive Quiz ⋅ 11 QuestionsBy Leodanis Pozo Ramos Share In this quiz, you’ll test your understanding of Python while Loops: Repeating Tasks Conditionally. The while keyword is used to initiate a loop that repeats a block of code while a condition is true. A while loop works by evaluating a condition at the start of each iteration. If the condition is true, then the loop executes. Otherwise, it terminates. The quiz contains 11 questions and there is no time limit. […]

Read more

Quiz: Python Bytes

Interactive Quiz ⋅ 15 QuestionsBy Bartosz Zaczyński Share In this quiz, you’ll test your understanding of Bytes Objects: Handling Binary Data in Python. By working through this quiz, you’ll revisit the key concepts related to this low-level data type. The quiz contains 15 questions and there is no time limit. You’ll get 1 point for each correct answer. At the end of the quiz, you’ll receive a total score. The maximum score is 100%. Good luck! Related Resources

Read more

Quiz: How to Work With Polars LazyFrames

Interactive Quiz ⋅ 10 QuestionsBy Ian Eyre Share In this quiz, you’ll test your understanding of the techniques covered in How to Work With Polars LazyFrames. By working through the questions, you’ll review your understanding of why LazyFrames are an efficient and preferred way of working in Polars. You’ll need to do some research outside of the tutorial to answer all the questions, so let this challenge take you on a learning journey. The quiz contains 10 questions and there […]

Read more

How to Work With Polars LazyFrames

A Polars LazyFrame provides an efficient way to handle large datasets through lazy evaluation. Unlike traditional DataFrames, LazyFrames don’t contain data but instead store a set of instructions known as a query plan. Query plans perform operations like predicate and projection pushdown, ensuring only necessary rows and columns are processed. LazyFrames also support the parallel execution of query plans, further enhancing performance. By the end of this tutorial, you’ll understand that: A Polars LazyFrame allows efficient data processing by storing […]

Read more

Single and Double Underscore Naming Conventions in Python

Python has a few important naming conventions that are based on using either a single or double underscore character (_). These conventions allow you to differentiate between public and non-public names in APIs, write safe classes for subclassing purposes, avoid name clashes, and more. Following and respecting these conventions allows you to write code that looks Pythonic and consistent in the eyes of other Python developers. This skill is especially useful when you’re writing code that’s intended for other developers […]

Read more
1 2 3 4 187