Python tutorials

Quiz: Deep vs Shallow Copies in Python

Interactive Quiz ⋅ 7 QuestionsBy Joseph Peart Share Ready to reinforce your knowledge of deep and shallow copies in Python? This quiz covers assignment semantics, object identity, and how to properly copy nested and user-defined objects. You will also practice writing your own copy helpers and customizing class copying. Brush up on these essential concepts before you start by reviewing Deep vs Shallow Copies in Python. The quiz contains 7 questions and there is no time limit. You’ll get 1 […]

Read more

Quiz: Exploring Python Closures: Examples and Use Cases

Interactive Quiz ⋅ 11 QuestionsBy Stephen Gruppetta Share In this quiz, you’ll test your understanding of Python closures. Closures are a common feature in functional programming languages and are particularly popular in Python because they allow you to create function-based decorators. Take this quiz after taking our Exploring Python Closures: Examples and Use Cases course. The quiz contains 11 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: Working With Python’s .__dict__ Attribute

Interactive Quiz ⋅ 7 QuestionsBy Steven Loyens Share This quiz helps you sharpen your understanding of Python’s .__dict__ attribute. You’ll revisit how attributes are stored, who actually has a .__dict__, what mappingproxy means, and why __slots__ matters. Get ready to test your knowledge after watching Working With Python’s .__dict__ Attribute. 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. […]

Read more

Quiz: Exploring Python T-Strings

Interactive Quiz ⋅ 10 QuestionsBy Christopher Trudeau Share Ready to brush up on Python’s powerful string formatting tools? This quiz walks you through the essential techniques, including f-strings, C-style formatting, and str.format(). You’ll also get hands-on with a newer feature in Python 3.14: t-strings. The quiz contains 10 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 […]

Read more

Quiz: Profiling Performance in Python

Interactive Quiz ⋅ 7 QuestionsBy Negar Vahid Share Ready to level up your Python code optimization skills? In this quiz, you’ll revisit key concepts about profiling, benchmarking, and diagnosing performance bottlenecks. You’ll practice with tools like cProfile and timeit, and see how deterministic and statistical profilers differ. Brush up on the profiling workflow and see how to spot hotspots efficiently in your programs. Need a refresher? Check out the Profiling Performance in Python for detailed guidance. The quiz contains 7 […]

Read more

Quiz: Python Annotations

Interactive Quiz ⋅ 9 QuestionsBy Bartosz Zaczyński Share In this quiz, you’ll test your understanding of lazy annotations introduced in Python 3.14. By working through this quiz, you’ll revisit how they improve performance, address forward reference issues, and support both static type checking and runtime processing. The quiz contains 9 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 […]

Read more

Python 3.14 Preview: Lazy Annotations

Recent Python releases have introduced several small improvements to the type hinting system, but Python 3.14 brings a single major change: lazy annotations. This change delays annotation evaluation until explicitly requested, improving performance and resolving issues with forward references. Library maintainers might need to adapt, but for regular Python users, this change promises a simpler and faster development experience. Explore how lazy annotations in Python 3.14 streamline your development process, offering both performance benefits and enhanced code clarity. If you’re […]

Read more

Quiz: Python Skill Test

Interactive Quiz ⋅ 12 QuestionsBy Martin Breuss Share 🐍 How Strong Are Your Python Skills? 🚀 This quick quiz gives you a snapshot of where you stand, whether you’re just starting out with Python or have years of coding under your belt. Test your Python skill by answering questions ranging from fundamentals to more advanced challenges. Each question is designed to test your understanding and maybe even teach you something new. Tip: Read the Explanation for each answer and follow […]

Read more

Profiling Performance in Python

Do you want to optimize the performance of your Python program to make it run faster or consume less memory? Before diving into any performance tuning, you should strongly consider using a technique called software profiling. It can help you decide whether optimizing the code is necessary and, if so, which parts of the code you should focus on. Sometimes, the return on investment in performance optimizations just isn’t worth the effort. If you only run your code once or […]

Read more

Quiz: How to Write Docstrings in Python

Interactive Quiz ⋅ 7 QuestionsBy Philipp Acsany Share Want to get comfortable writing and using Python docstrings? This quiz helps you revisit best practices, standard conventions, and common tools. You’ll review the basics of docstring syntax, how to read them at runtime, and different formatting styles. For more details, check out the tutorial How to Write Docstrings in Python. The quiz contains 7 questions and there is no time limit. You’ll get 1 point for each correct answer. At the […]

Read more
1 2 3 198