Python tutorials

Python’s Built-in Exceptions: A Walkthrough With Examples

Python has a complete set of built-in exceptions that provide a quick and efficient way to handle errors and exceptional situations that may happen in your code. Knowing the most commonly used built-in exceptions is key for you as a Python developer. This knowledge will help you debug code because each exception has a specific meaning that can shed light on your debugging process. You’ll also be able to handle and raise most of the built-in exceptions in your Python […]

Read more

HTML and CSS Foundations for Python Developers

When you want to build websites as a Python programmer, there’s no way around HTML and CSS. Almost every website on the Internet is built with HTML markup to structure the page. To make a website look nice, you can style HTML with CSS. If you’re interested in web development with Python, then knowing HTML and CSS will help you understand web frameworks like Django and Flask better. But even if you’re just getting started with Python, HTML and CSS […]

Read more

What Is the __pycache__ Folder in Python?

When you develop a self-contained Python script, you might not notice anything unusual about your directory structure. However, as soon as your project becomes more complex, you’ll often decide to extract parts of the functionality into additional modules or packages. That’s when you may start to see a __pycache__ folder appearing out of nowhere next to your source files in seemingly random places: project/ │ ├── mathematics/ │ │ │ ├── __pycache__/ │ │ │ ├── arithmetic/ │ │ ├── […]

Read more

PyTorch vs TensorFlow for Your Python Deep Learning Project

PyTorch vs TensorFlow: What’s the difference? Both are open-source Python libraries that use graphs to perform numerical computations on data in deep learning applications. Both are used extensively in academic research and commercial code. Both are extended by a variety of APIs, cloud computing platforms, and model repositories. If they’re so similar, then how do you decide which one is best for your project? You’ll start by taking a close look at both platforms, beginning with the slightly older TensorFlow. […]

Read more

Flattening a List of Lists in Python

Sometimes, when you’re working with data, you may have the data as a list of nested lists. A common operation is to flatten this data into a one-dimensional list in Python. Flattening a list involves converting a multidimensional list, such as a matrix, into a one-dimensional list. In this video course, you’ll learn how to do that in Python. What’s Included: Downloadable Resources:    

Read more

Python News: What’s New From April 2024

In April 2024, Python’s core development team released versions 3.13.0a6 and 3.12.3 of the language! The former received several exciting features, improvements, and optimizations, while the latter got more than 300 commits for security improvements and bug fixes. The 3.13.0a6 release is the last alpha release. In the first half of May, the code will be frozen and won’t accept new features. Note that 3.13.0a6 is a pre-release, so you shouldn’t use it for production environments. However, it provides a […]

Read more

Quiz: The Python calendar Module

Interactive Quiz ⋅ 6 QuestionsBy Bartosz Zaczyński In this quiz, you’ll test your understanding of creating calendars in Python using the calendar module. By working through this quiz, you’ll revisit the fundamental functions and methods provided by the calendar module. The quiz contains 6 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 […]

Read more

Working With Global Variables in Python Functions

A global variable is a variable that you can use from any part of a program, including within functions. Using global variables inside your Python functions can be tricky. You’ll need to differentiate between accessing and changing the values of the target global variable if you want your code to work correctly. Global variables can play a fundamental role in many software projects because they enable data sharing across an entire program. However, you should use them judiciously to avoid […]

Read more

Quiz: Inheritance and Composition: A Python OOP Guide

Interactive Quiz ⋅ 7 QuestionsBy Martin Breuss In this quiz, you’ll test your understanding of Inheritance and Composition in Python. By working through this quiz, you’ll revisit how to use inheritance and composition in Python, model class hierarchies, and use multiple inheritance. The quiz contains 7 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: Get Started With Django: Build a Portfolio App

Interactive Quiz ⋅ 10 QuestionsBy Martin Breuss In this quiz, you’ll test your understanding of Django. By working through this quiz, you’ll revisit the steps you need to get started with Django. You’ll touch on topics that will help you create a fully functioning web application and revisit some of the most important features of Django. You’ll also investigate the architecture of a Django site, remember how to set up a new Django project with multiple apps, build models and […]

Read more
1 17 18 19 20 21 185