Efficient String Concatenation in Python

String concatenation is a common operation in programming. It involves joining two or more strings to create a single new string. You’ll find several tools and techniques for concatenating strings in Python, each with its own pros and cons. In this tutorial, you’ll go through the most common tools and techniques for concatenating strings. You’ll also code examples for each of them, which will help you choose the best option for your specific problems. In this tutorial, you’ll: Understand what […]

Read more

Goodbye to Flake8 and PyLint: faster linting with Ruff

Flake8 and PyLint are commonly used, and very useful, linting tools: they can help you find potential bugs and other problems with your code, aka “lints”. But they can also be slow. And even if they’re fast on your computer, they may still be slow in your CI system (GitHub Actions, GitLab, or whatever else.) Happily, there’s a new linter available, Ruff, which is much faster. And it supports many of the same lints, including those from many of Flake8’s […]

Read more

Publishing Python Packages to PyPI

PyPI is the public hosting service where open-source Python packages live. When you pip install a package, that’s where it fetches it from. In this course, you’ll learn all about the structures of a package and how to upload your own to the PyPI server. In this video course, you’ll learn about: Why packages and virtual environments exist How to structure a package How to use build systems The contents of the pyproject.toml file How to use the build and […]

Read more

SOLID Principles: Improve Object-Oriented Design in Python

When you build a Python project using object-oriented programming (OOP), planning how the different classes and objects will interact to solve your specific problems is an important part of the job. This planning is known as object-oriented design (OOD), and getting it right can be a challenge. If you’re stuck while designing your Python classes, then the SOLID principles can help you out. SOLID is a set of five object-oriented design principles that can help you write more maintainable, flexible, […]

Read more

Python Classes: The Power of Object-Oriented Programming

Python supports the object-oriented programming paradigm through classes. They provide an elegant way to define reusable pieces of code that encapsulate data and behavior in a single entity. With classes, you can quickly and intuitively model real-world objects and solve complex problems. If you’re new to classes, need to refresh your knowledge, or want to dive deeper into them, then this tutorial is for you! In this tutorial, you’ll learn how to: Define Python classes with the class keyword Add […]

Read more

Using Python’s assert to Debug and Test Your Code

Python’s assert statement allows you to write sanity checks in your code. These checks are known as assertions, and you can use them to test if certain assumptions remain true while you’re developing your code. If any of your assertions turn false, then you have a bug in your code. Assertions are a convenient tool for documenting, debugging, and testing code during development. Once you’ve debugged and tested your code with the help of assertions, then you can turn them […]

Read more
1 98 99 100 101 102 913