Python tutorials

Python News Roundup: October 2024

October is always an important month for Python, as this is when a new major version is released. Python 3.13 is the new version this year, and it brings several new features that lay the groundwork for other changes in the future. As one version of Python comes to life, another is put to rest. Python 3.8 is already five years old, which means that this version won’t be supported any longer. There are also exciting developments happening in the […]

Read more

Quiz: Iterators and Iterables in Python: Run Efficient Iterations

Interactive Quiz ⋅ 20 QuestionsBy Martin Breuss Share In this quiz, you’ll test your understanding of Python’s Iterators and Iterables. By working through this quiz, you’ll revisit how to create and work with iterators and iterables, understand the differences between them, and review how to use generator functions and the yield statement. The quiz contains 20 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 […]

Read more

Quiz: Python import: Advanced Techniques and Tips

Interactive Quiz ⋅ 5 QuestionsBy Martin Breuss Share In this quiz, you’ll test your understanding of Python’s import statement and related topics. By working through this quiz, you’ll revisit how to use modules in your scripts and import modules dynamically at runtime. 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! « […]

Read more

Quiz: When to Use a List Comprehension in Python

Interactive Quiz ⋅ 8 QuestionsBy Martin Breuss Share In this quiz, you’ll test your understanding of List Comprehension in Python. By working through this quiz, you’ll revisit how to rewrite loops as list comprehensions, how to choose when to use list comprehensions, how you can use conditional logic in your comprehensions, and how to profile your code to resolve performance questions. The quiz contains 8 questions and there is no time limit. You’ll get 1 point for each correct answer. […]

Read more

Beyond multi-core parallelism: faster Mandelbrot with SIMD

What do you do when computation is too expensive? Recently I’ve had a brilliant business idea: Mandelbrot-as-a-Service! Instead of companies calculating their own fractals, I will do it for them, freshly calculated in the cloud, with no work on their part. And by using cloud computing, I will be able to scale to the no-doubt vast number of customers who will be paying for my ingenious new service. I have two goals: Speeding up results: The faster I can return […]

Read more

Quiz: A Guide to Modern Python String Formatting Tools

Interactive Quiz ⋅ 10 QuestionsBy Leodanis Pozo Ramos Share Test your understanding of Python’s tools for string formatting, including f-strings and the .format() method. Take this quiz after reading our A Guide to Modern Python String Formatting Tools tutorial. 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 luck! « Browse All Python […]

Read more

A Guide to Modern Python String Formatting Tools

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: Formatting Python Strings When working with strings in Python, you may need to interpolate values into your string and format these values to create new strings dynamically. In modern Python, you have f-strings and the .format() method to approach the tasks of interpolating and formatting strings. To get the most out of this tutorial, […]

Read more

Differences Between Python’s Mutable and Immutable Types

As a Python developer, you’ll have to deal with mutable and immutable objects sooner or later. Mutable objects are those that allow you to change their value or data in place without affecting the object’s identity. In contrast, immutable objects don’t allow this kind of operation. You’ll just have the option of creating new objects of the same type with different values. In Python, mutability is a characteristic that may profoundly influence your decision when choosing which data type to […]

Read more

Python 3.13: Cool New Features for You to Try

Python 3.13 will be published on October 1, 2024. This new version is a major step forward for the language, although several of the biggest changes are happening under the hood and won’t be immediately visible to you. In a sense, Python 3.13 is laying the groundwork for some future improvements, especially to the language’s performance. As you read on, you’ll learn more about the background for this and dive into some new features that are fully available now. In […]

Read more

Quiz: Python 3.13: Free Threading and a JIT Compiler

Interactive Quiz ⋅ 16 QuestionsBy Bartosz Zaczyński Share In this quiz, you’ll test your understanding of the new features in Python 3.13. By working through this quiz, you’ll revisit how to compile a custom Python build, disable the Global Interpreter Lock (GIL), enable the Just-In-Time (JIT) compiler, determine the availability of new features at runtime, assess the performance improvements in Python 3.13, and make a C extension module targeting Python’s new ABI. The quiz contains 16 questions and there is […]

Read more
1 3 4 5 6 7 181