Python tutorials

The Django Template Language: Tags and Filters

Django is a powerful framework for creating web applications in Python. Its features include database models, routing URLs, authentication, user management, administrative tools, and a template language. You can compose reusable HTML that changes based on the data you pass to the template language. Django templates use tags and filters to define a mini-language that’s similar to Python—but isn’t Python. You’ll get to know Django templates through the tags and filters you use to compose reusable HTML. In this tutorial, […]

Read more

Pass by Reference in Python: Best Practices

After gaining some familiarity with Python, you may notice cases in which your functions don’t modify arguments in place as you might expect, especially if you’re familiar with other programming languages. Some languages handle function arguments as references to existing variables, which is known as pass by reference. Other languages handle them as independent values, an approach known as pass by value. If you’re an intermediate Python programmer who wishes to understand Python’s peculiar way of handling function arguments, then […]

Read more

Using the “and” Boolean Operator in Python

Python has three Boolean operators, or logical operators: and, or, and not. You can use them to check if certain conditions are met before deciding the execution path your programs will follow. In this tutorial, you’ll learn about the and operator and how to use it in your code. You’ll also code a few practical examples that will help you understand how to use the and operator to approach different problems in a Pythonic way. Even if you don’t use […]

Read more

Using Podman with BuildKit, the better Docker image builder

BuildKit is a new and improved tool for building Docker images: it’s faster, has critical features missing from traditional Dockerfiles like build secrets, plus additionally useful features like cache mounting. So if you’re building Docker images, using BuildKit is in general a good idea. And then there’s Podman: Podman is a reimplemented, compatible version of the Docker CLI and API. It does not however implement all the BuildKit Dockerfile extensions. On its own, then, Podman isn’t as good as Docker […]

Read more

Build a Personal Diary With Django and Python

A diary is a personal safe space. With the help of Django, you can create a diary on your own computer without storing data in anyone else’s cloud. By following along with the project below, you’ll see how quickly you can build a functioning web app in Django without any external dependencies. In this tutorial, you’ll learn how to: Set up a Django project Work with the standard SQLite database Make use of the Django admin site Create models and […]

Read more

Using Data Classes in Python

One new and exciting feature that came out in Python 3.7 was the data class. A data class is a class typically containing mainly data, although there aren’t really any restrictions. With data classes, you don’t have to write boilerplate code to get proper initialization, representation, and comparisons for your objects. In this course, you’ll learn how to: Define your own data classes Add default values to the fields in your data class Customize the ordering of data class objects […]

Read more

Python News: What’s New From August 2021?

Summer holidays have ended, and it’s back to school again. While it was a time of leisure and getting disconnected from the virtual world for many of us, the Python maintainers and contributors have been busy working during that same period. Just in August 2021, the Python community saw three new Python releases, bringing some important security fixes, optimizations, and brand-new features. Let’s dive into the biggest Python news from the past month! Python 3.10 Is Almost Ready On August […]

Read more

A Python Guide to the Fibonacci Sequence

With stacks, you’ll effectively see how each call in a recursive function is handled. The way each call is pushed onto the stack and popped off is exactly how the program is run, and it’ll clearly demonstrate how calculating large numbers will take a long time, if not optimized. Illustrating Visualization Using a Call Stack In a call stack, whenever a function call returns a result, a stack frame representing the function call is popped off the stack. Whenever you […]

Read more

Graph Your Data With Python and ggplot

In this course, you’ll learn how to use ggplot in Python to create data visualizations using a grammar of graphics. A grammar of graphics is a high-level tool that allows you to create data plots in an efficient and consistent way. It abstracts most low-level details, letting you focus on creating meaningful and beautiful visualizations for your data. There are several Python packages that provide a grammar of graphics. This course focuses on plotnine since it’s one of the most […]

Read more

How Long Does It Take to Learn Python?

You’ve probably found at least one blog post where the author reveals that they learned Python in a handful of days and quickly transitioned into a high-paying job. Some of these stories may be true, but they don’t help you prepare for a steady learning marathon. So, how long does it really take to learn Python, and is it worth your time investment? In this article, you’ll learn: What “learning Python” means and how you can measure your progress What […]

Read more
1 105 106 107 108 109 181