Python tutorials

Quiz: Python Protocols: Leveraging Structural Subtyping

Interactive Quiz ⋅ 11 QuestionsBy Leodanis Pozo Ramos Share Or copy the link: Copied! Happy Pythoning! Test your understanding of how to create and use Python protocols while providing type hints for your functions, variables, classes, and methods. Take this quiz after reading our Python Protocols: Leveraging Structural Subtyping tutorial. The quiz contains 11 questions and there is no time limit. You’ll get 1 point for each correct answer. At    

Read more

Quiz: Logging in Python

Interactive Quiz ⋅ 9 QuestionsBy Philipp Acsany Share Or copy the link: Copied! Happy Pythoning! In this quiz, you’ll test your understanding of Python’s logging module. Logging is a very useful tool in a programmer’s toolbox. It can help you develop a better understanding of the flow of a program and discover scenarios that you might not have thought of while developing. Logs provide developers with an extra set of eyes that are constantly looking    

Read more

Quiz: Hugging Face Transformers

Interactive Quiz ⋅ 6 QuestionsBy Bartosz Zaczyński Share Or copy the link: Copied! Happy Pythoning! In this quiz, you’ll test your understanding of Hugging Face Transformers. This library is a popular choice for working with transformer models in natural language processing tasks, computer vision, and other machine learning applications. The quiz contains 6 questions and there is no time limit. You’ll get 1 point for each correct answer. At the    

Read more

Hugging Face Transformers: Leverage Open-Source AI in Python

Transformers is a powerful Python library created by Hugging Face that allows you to download, manipulate, and run thousands of pretrained, open-source AI models. These models cover multiple tasks across modalities like natural language processing, computer vision, audio, and multimodal learning. Using pretrained open-source models can reduce costs, save the time needed to train models from scratch, and give you more control over the models you deploy. Throughout this tutorial, you’ll gain a conceptual understanding of Hugging Face’s AI offerings and learn how to […]

Read more

pandas GroupBy: Grouping Real World Data in Python

Whether you’ve just started working with pandas and want to master one of its core capabilities, or you’re looking to fill in some gaps in your understanding about .groupby(), this course will help you to break down and visualize a pandas GroupBy operation from start to finish. This course is meant to complement the official pandas documentation and the pandas Cookbook, where there are self-contained, bite-sized examples. Here, however, you’ll focus on three more involved walkthroughs that use real-world datasets. […]

Read more

Quiz: Python Strings and Character Data

Interactive Quiz ⋅ 11 QuestionsBy Leodanis Pozo Ramos Share Or copy the link: Copied! Happy Pythoning! This quiz will evaluate your understanding of Python’s string data type and test your knowledge about manipulating textual data with string objects. You’ll cover the basics of creating strings using literals and the str() function, applying string methods, using operators and built-in functions with strings, indexing and slicing strings, and more! Take this quiz after reading our Strings and    

Read more

Quiz: How Do You Choose Python Function Names?

Interactive Quiz ⋅ 7 QuestionsBy Martin Breuss Share Or copy the link: Copied! Happy Pythoning! In this quiz, you’ll test your understanding of how to choose Python function names. By working through this quiz, you’ll revisit the rules and conventions for naming Python functions and why they’re important for writing Pythonic code. Choosing the ideal Python function names makes your code more readable and easier to maintain. Code with well-chosen names can also be    

Read more

Python Protocols: Leveraging Structural Subtyping

In Python, a protocol specifies the methods and attributes that a class must implement to be considered of a given type. Protocols are important in Python’s type hint system, which allows for static type checking through external tools, such as mypy, Pyright, and Pyre. Before there were protocols, these tools could only check for nominal subtyping based on inheritance. There was no way to check for structural subtyping, which relies on the internal structure of classes. This limitation affected Python’s […]

Read more

Quiz: How to Write Beautiful Python Code With PEP 8

Interactive Quiz ⋅ 12 QuestionsBy Martin Breuss Share Or copy the link: Copied! Happy Pythoning! In this quiz, you’ll test your understanding of how to write beautiful Python code with PEP 8. By working through this quiz, you’ll revisit the key guidelines laid out in PEP 8 and how to set up your development environment to write PEP 8 compliant Python code. The quiz contains 12 questions and there is    

Read more

Quiz: How to Use Generators and yield in Python

Interactive Quiz ⋅ 10 QuestionsBy Martin Breuss Share Or copy the link: Copied! Happy Pythoning! In this quiz, you’ll test your understanding of Python generators. Generators and the Python yield statement can help you when you’re working with large datasets that might overwhelm your machine’s memory. Another use case is when you have a complex function that needs to maintain an internal state every time it’s called. When you understand Python generators, then you’ll be    

Read more
1 2 3 172