Python tutorials

Check if a Python String Contains a Substring

If you’re new to programming or come from a programming language other than Python, you may be looking for the best way to check whether a string contains another string in Python. Identifying such substrings comes in handy when you’re working with text content from a file or after you’ve received user input. You may want to perform different actions in your program depending on whether a substring is present or not. In this video course, you’ll focus on the […]

Read more

Python’s del: Remove References From Scopes and Containers

Python’s del statement will allow you to remove names and references from different namespaces. It’ll also allow you to delete unneeded items from your lists and keys from your dictionaries. If you want to learn how to use del in your Python code, then this tutorial is for you. The del statement empowers you to better manage memory resources in your code, making your programs more efficient. To get the most out of this tutorial, you should be familiar with […]

Read more

Staying secure by breaking Docker caching

When building Docker images, caching lets you speed up rebuilding images. But this has a downside: it can keep you from installing security updates from your base Linux distribution. If you cache the image layer that includes the security update… you’re not getting new security updates! There are a number of ways you can try to balance caching with getting security updates, with different tradeoffs. In this article we’ll cover: Caching by default, with recurring rebuild and redeploys. Deliberately breaking […]

Read more

Build a Maze Solver in Python Using Graphs

If you’re up for a little challenge and would like to take your programming skills to the next level, then you’ve come to the right place! In this hands-on tutorial, you’ll practice object-oriented programming, among several other good practices, while building a cool maze solver project in Python. From reading a maze from a binary file, to visualizing it using scalable vector graphics (SVG), to finding the shortest path from the entrance to the exit, you’ll go step by step […]

Read more

YAML: Python’s Missing Battery

Python is often marketed as a batteries-included language because it comes with almost everything you’d ever expect from a programming language. This statement is mostly true, as the standard library and the external modules cover a broad spectrum of programming needs. However, Python lacks built-in support for the YAML data format, commonly used for configuration and serialization. In this video course, you’ll learn how to work with YAML in Python using the available third-party libraries, with a focus on PyYAML. […]

Read more

How to Read Python Input as Integers

If you’ve ever coded an interactive text-based application in Python, then you’ve probably found that you need a reliable way of asking the user for integers as input. It’s not enough simply to display a prompt and then gather keystrokes. You must check that the user’s input really represents an integer. If it doesn’t, then your code must react appropriately—typically by repeating the prompt. In this tutorial, you’ll learn how to create a reusable utility function that’ll guarantee valid integer […]

Read more
1 48 49 50 51 52 189