Python tutorials

Modern Python Linting With Ruff

Linting is essential to writing clean and readable code that you can share with others. A linter, like Ruff, is a tool that analyzes your code and looks for errors, stylistic issues, and suspicious constructs. Linting allows you to address issues and improve your code quality before you commit your code and share it with others. Ruff is a modern linter that’s extremely fast and has a simple interface, making it straightforward to use. It also aims to be a […]

Read more

Quiz: Astral’s ty Type Checker for Python

Interactive Quiz ⋅ 7 QuestionsBy Bartosz Zaczyński Share In this quiz, you’ll revisit the key concepts from Astral’s ty: A New Blazing-Fast Type Checker for Python. You’ll check your understanding of installing ty from PyPI, running type checks, and interpreting its structured diagnostics. You’ll also recall how to configure and silence specific rules, limit the scope of checks, and adjust Python version or platform settings. By completing this quiz, you’ll cement your ability to experiment confidently with ty in personal […]

Read more

Astral’s ty: A New Blazing-Fast Type Checker for Python

After Ruff and uv, the Astral team is back with another Rust-based tool called ty, short for type check. This new tool delivers a lightning-fast static type-checking experience in Python, aiming to outpace existing tools in both performance and convenience. By incorporating ty into your daily workflow, you’ll catch type-related bugs earlier and get clearer feedback. But is ty suitable for you? Take a look at the table below to make a quick decision: Use Case Pick ty Pick Other […]

Read more

How to Drop Null Values in pandas With .dropna()

Missing values can derail your analysis. In pandas, you can use the .dropna() method to remove rows or columns containing null values—in other words, missing data—so you can work with clean DataFrames. In this tutorial, you’ll learn how this method’s parameters let you control exactly which data gets removed. As you’ll see, these parameters give you fine-grained control over how much of your data to clean. Dealing with null values is essential for keeping datasets clean and avoiding the issues […]

Read more

Python MCP: Connect Your LLM With the World

The Model Context Protocol (MCP) is a new open protocol that allows AI models to interact with external systems in a standardized, extensible way. In this tutorial, you’ll install MCP, explore its client-server architecture, and work with its core concepts: prompts, resources, and tools. You’ll then build and test a Python MCP server that queries e-commerce data and integrate it with an AI agent in Cursor to see real tool calls in action. By the end of this tutorial, you’ll […]

Read more

Quiz: Strip Characters From a Python String

Interactive Quiz ⋅ 10 QuestionsBy Joseph Peart Share Brush up on how Python’s strip, lstrip, and rstrip string methods work. You’ll practice how to remove whitespace, specific characters, and use the right tool for trimming string ends. Try these questions to check your understanding of default stripping, custom character sets, and the difference between stripping characters and removing sequences. Need a refresher? See Strip Characters From a Python String. The quiz contains 10 questions and there is no time limit. […]

Read more

Strip Characters From a Python String

By default, Python’s .strip() method removes whitespace characters from both ends of a string. To remove different characters, you can pass a string as an argument that specifies a set of characters to remove. The .strip() method is useful for tasks like cleaning user input, standardizing filenames, and preparing data for storage. By the end of this video course, you’ll understand that: The .strip() method removes leading and trailing whitespace but doesn’t remove whitespace from the middle of a string. […]

Read more

Quiz: Get Started With FastAPI

Interactive Quiz ⋅ 5 QuestionsBy Philipp Acsany Share Brush up on core FastAPI concepts with this short quiz. You’ll revisit how to install FastAPI with extras, define API endpoints, and understand path and query parameters. See how FastAPI handles JSON responses and where to find the built-in API docs. Want to review first? Check out Get Started With FastAPI for a practical walkthrough of these features. The quiz contains 5 questions and there is no time limit. You’ll get 1 […]

Read more

Get Started With FastAPI

FastAPI is a web framework for building APIs with Python. It leverages standard Python type hints to provide automatic validation, serialization, and interactive documentation. When you’re deciding between Python web frameworks, FastAPI stands out for its speed, developer experience, and built-in features that reduce boilerplate code for API development: Use Case Pick FastAPI Pick Flask or Django You want to build an API-driven web app ✅ — You need a full-stack web framework — ✅ You value automatic API documentation […]

Read more

Quiz: What Can You Do With Python?

Interactive Quiz ⋅ 11 QuestionsBy Martin Breuss Share Sharpen your sense of where Python fits. You’ll revisit web frameworks, CLIs and TUIs, GUIs, data work, and robotics. Use hints when stuck, then read the explanations. For a quick big-picture refresher, watch What Can You Do With Python?. The quiz contains 11 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 […]

Read more
1 2 3 4 5 203