Python tutorials

How to Get the First Match From a Python List or Iterable

At some point in your Python journey, you may need to find the first item that matches a certain criterion in a Python iterable, such as a list or dictionary. The simplest case is that you need to confirm that a particular item exists in the iterable. For example, you want to find a name in a list of names or a substring inside a string. In these cases, you’re best off using the in operator. However, there are many […]

Read more

When should you upgrade to Python 3.11?

Python 3.11 is out now–but should you switch to it immediately? And if you shouldn’t upgrade just yet, when should you? The short answer is that, no, you probably don’t want to switch immediately; quite possibly you can’t switch immediately. To understand why, we need to consider Python packaging, the software development process, and take a look at the history of past releases. We can then make a guess about when Python 3.11 will actually be usable. The problems with […]

Read more
1 86 87 88 89 90 203