Python tutorials

Quiz: Using Loguru to Simplify Python Logging

Interactive Quiz ⋅ 8 QuestionsBy Joseph Peart Share In this quiz, you’ll test your understanding of Using Loguru to Simplify Python Logging. By working through this quiz, you’ll revisit key concepts like the pre-configured logger, log levels, format placeholders, adding context with .bind() and .contextualize(), and saving logs to files. The quiz contains 8 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. […]

Read more

Quiz: Building a Python GUI Application With Tkinter

Interactive Quiz ⋅ 10 QuestionsBy Joseph Peart Share In this quiz, you’ll test your understanding of Building a Python GUI Application With Tkinter. Test your Tkinter knowledge by identifying core widgets, managing layouts, handling text with Entry and Text widgets, and connecting buttons to Python functions. This quiz also covers event loops, widget sizing, and file dialogs, helping you solidify the essentials for building interactive, cross-platform Python GUI apps. The quiz contains 10 questions and there is no time limit. […]

Read more

Using Loguru to Simplify Python Logging

Logging is a vital programming practice that helps you track, understand, and debug your application’s behavior. Loguru is a Python library that provides simpler, more intuitive logging compared to Python’s built-in logging module. Good logging gives you insights into your program’s execution, helps you diagnose issues, and provides valuable information about your application’s health in production. Without proper logging, you risk missing critical errors, spending countless hours debugging blind spots, and potentially undermining your project’s overall stability. By the end […]

Read more

Quiz: For Loops in Python (Definite Iteration)

Interactive Quiz ⋅ 5 QuestionsBy Joseph Peart Share Test your understanding of For Loops in Python (Definite Iteration). You’ll revisit Python loops, iterables, and how iterators behave. You’ll also explore set iteration order and the effects of the break and continue statements. The quiz contains 5 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 […]

Read more

D-Strings Could End Your textwrap.dedent() Days and Other Python News for April 2026

If you’ve ever wrapped a multiline string in textwrap.dedent() and wondered why Python can’t just handle that for you, then your PEP has arrived. PEP 822 proposes d-strings, a new d”””…””” prefix that automatically strips leading indentation. It’s one of those small quality-of-life ideas that make you wonder why it didn’t exist already. The PEP is currently a draft proposal. March also delivered Python 3.15.0 alpha 7 with lazy imports you can finally test and security patches across three older […]

Read more

Quiz: Class Concepts: Object-Oriented Programming in Python

Interactive Quiz ⋅ 8 QuestionsBy Martin Breuss Share In this quiz, you’ll test your understanding of Class Concepts: Object-Oriented Programming in Python. By working through this quiz, you’ll revisit how to define classes, use instance and class attributes, write different types of methods, and apply the descriptor protocol through properties. You can also deepen your knowledge with the tutorial Python Classes: The Power of Object-Oriented Programming. The quiz contains 8 questions and there is no time limit. You’ll get 1 […]

Read more

Quiz: How to Add Features to a Python Project With Codex CLI

Interactive Quiz ⋅ 7 QuestionsBy Joseph Peart Share In this quiz, you’ll test your understanding of How to Add Features to a Python Project With Codex CLI. By working through this quiz, you’ll revisit how to install, configure, and use Codex CLI to implement and refine features in a Python project using natural language prompts. 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, […]

Read more

Quiz: Python’s Counter: The Pythonic Way to Count Objects

Interactive Quiz ⋅ 11 QuestionsBy Martin Breuss Share In this quiz, you’ll test your understanding of Python’s Counter: The Pythonic Way to Count Objects. By working through this quiz, you’ll revisit how to create Counter objects, update counts, find most common elements, and use counters as multisets with arithmetic operations. This quiz covers practical Counter tasks such as constructing counters from different data types, accessing counts, and working with multiset operations. If you want a deeper walkthrough, review the tutorial […]

Read more

Timesliced reservoir sampling: a new(?) algorithm for profilers

Imagine you are processing a stream of events, of unknown length. It could end in 3 seconds, it could run for 3 months; you simply don’t know. As a result, storing the whole stream in memory or even on disk is not acceptable, but you still need to extract relevant information. Depending on what information you need, choosing a random sample of the stream will give you almost as good information as storing all the data. For example, consider a […]

Read more

Quiz: Exploring Keywords in Python

Interactive Quiz ⋅ 6 QuestionsBy Joseph Peart Share In this quiz, you’ll test your understanding of Exploring Keywords in Python. By working through this quiz, you’ll revisit how to identify Python keywords, understand the difference between regular and soft keywords, categorize keywords by purpose, and avoid common pitfalls with deprecated keywords. The quiz contains 6 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 […]

Read more
1 2 3 215