Python tutorials

Quiz: What Does -> Mean in Python Function Definitions?

Interactive Quiz ⋅ 8 QuestionsBy Philipp Acsany Share In this quiz, you will revisit how Python uses the arrow notation (->) in function signatures to provide return type hints. Practice identifying correct syntax, annotating containers, and understanding the role of tools like mypy. Brush up on key concepts, clarify where and how to use return type hints, and see practical examples in What Does -> Mean in Python Function Definitions?. The quiz contains 8 questions and there is no time […]

Read more

Quiz: Python Project Management With uv

Interactive Quiz ⋅ 6 QuestionsBy Rodrigo Girão Serrão Share In this quiz, you will review how to use uv, the high-speed Python package and project manager. You will practice key commands, explore the files uv creates for you, and work with project setup tasks. This is a great way to reinforce project management basics with uv and get comfortable with its streamlined workflows. The quiz contains 6 questions and there is no time limit. You’ll get 1 point for each […]

Read more

What Does -> Mean in Python Function Definitions?

In Python, the arrow symbol (->) appears in function definitions as a notation to indicate the expected return type. This notation is optional, but when you include it, you clarify what data type a function should return: >>> def get_number_of_titles(titles: list[str]) -> int: … return len(titles) … You may have observed that not all Python code includes this particular syntax. What does the arrow notation mean? In this    

Read more

Quiz: How to Drop Null Values in pandas

Interactive Quiz ⋅ 10 QuestionsBy Ian Eyre Share Challenge yourself with this quiz and see how much you understand about dropping null values in pandas. Working through this quiz is a great way to revisit what you learned in the How to Drop Null Values in pandas tutorial. You’ll find most of the answers in the tutorial content, but for some of the questions, you might need to do some extra digging. The quiz contains 10 questions and there is […]

Read more

How to Drop Null Values in pandas

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

Testing the compiler optimizations your code relies on

In a recent article by David Lattimore, he demonstrates a number of Rust performance tricks, including one that involve writing code that looks like a loop, but which in practice is optimized down to a fixed number of instructions. Having what looks like an O(n) loop turned into a constant operation is great for speed! But there’s a problem with this sort of trick: how do you know the compiler will keep doing it? What happens when the compiler’s next […]

Read more

Quiz: Defining and Calling Python Functions

Interactive Quiz ⋅ 9 QuestionsBy Martin Breuss Share Ready to revisit how Python functions work? In this quiz, you’ll practice defining and calling functions, using positional and keyword arguments, managing defaults, and writing docstrings. You’ll also get hands-on with collecting extra arguments and enforcing how callers pass them. Sharpen your skills by applying the concepts from Defining and Calling Functions in Python. The quiz contains 9 questions and there is no time limit. You’ll get 1 point for each correct […]

Read more

Quiz: Sorting Dictionaries in Python: Keys, Values, and More

Interactive Quiz ⋅ 11 QuestionsBy Stephen Gruppetta Share This quiz helps you practice sorting dictionaries by keys, values, and custom rules in modern Python. You’ll revisit how insertion order works, when to use different views, and how to rebuild sorted dictionaries. You’ll also learn best practices for sorting dictionaries efficiently. For a complete overview, check out Sorting Dictionaries: Keys, Values, and More. The quiz contains 11 questions and there is no time limit. You’ll get 1 point for each correct […]

Read more

Python String Splitting

Python’s .split() method lets you divide a string into a list of substrings based on a specified delimiter. By default, .split() separates at whitespace, including spaces, tabs, and newlines. You can customize .split() to work with specific delimiters using the sep parameter, and control the amount of splits with maxsplit. By the end of this video course, you’ll understand that: You split a string by spaces in Python using .split() without arguments. Python’s .split() method can split on custom delimiters […]

Read more

The Python Documentary Celebrates History While Developer Surveys Celebrate Python

Python is making history, and headlines. The much-anticipated Python: The Documentary premiered last month, capturing 34 years of programming history. But Python isn’t just looking back, it’s also moving forward at breakneck speed. The recent developer surveys revealed Python’s explosive growth. At the same time, the Python Software Foundation paused its grants program amid unprecedented demand, PyPI implemented multiple security enhancements, while JetBrains announced a transition for PyCharm Community Edition into a unified product model. Here’s what’s been happening in […]

Read more
1 2 3 200