Python tutorials

Quiz: Python Virtual Environments: A Primer

Interactive Quiz ⋅ 10 QuestionsBy Kate Finegan Share So you’ve been primed on Python virtual environments! Test your understanding of the tutorial here. The quiz contains 10 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! Start the Quiz » « Browse All Python Quizzes    

Read more

Quiz: Python 3.13: Free-Threading and a JIT Compiler

Interactive Quiz ⋅ 16 QuestionsBy Bartosz Zaczyński Share In this quiz, you’ll test your understanding of the new features in Python 3.13. By working through this quiz, you’ll revisit how to compile a custom Python build, disable the Global Interpreter Lock (GIL), enable the Just-In-Time (JIT) compiler, determine the availability of new features at runtime, assess the performance improvements in Python 3.13, and make a C extension module targeting Python’s new ABI. The quiz contains 16 questions and there is […]

Read more

How to Use Conditional Expressions With NumPy where()

The NumPy where() function is a powerful tool for filtering array elements in lists, tuples, and NumPy arrays. It works by using a conditional predicate, similar to the logic used in the WHERE or HAVING clauses in SQL queries. It’s okay if you’re not familiar with SQL—you don’t need to know it to follow along with this tutorial. You would typically use np.where() when you have an array and need to analyze its elements differently depending on their values. For […]

Read more

When to Use .__repr__() vs .__str__() in Python

One of the most common tasks that a computer program performs is to display data. The program often displays this information to the program’s user. However, a program also needs to show information to the programmer developing and maintaining it. The information a programmer needs about an object differs from how the program should display the same object for the user, and that’s where .__repr__() vs .__str__() comes in. A Python object has several special methods that provide specific behavior. […]

Read more

Python News Roundup: September 2024

As the autumn leaves start to fall, signaling the transition to cooler weather, the Python community has warmed up to a series of noteworthy developments. Last month, a new maintenance release of Python 3.12.5 was introduced, reinforcing the language’s ongoing commitment to stability and security. On a parallel note, Python continues its reign as the top programming language according to IEEE Spectrum’s annual rankings. This sentiment is echoed by the Python Developers Survey 2023 results, which reveal intriguing trends and […]

Read more

Quiz: Lists vs Tuples in Python

Interactive Quiz ⋅ 10 QuestionsBy Leodanis Pozo Ramos Share Challenge yourself with this quiz to evaluate and deepen your understanding of Python lists and tuples. You’ll explore key concepts, such as how to create and manipulate these data types, while also learning best practices for using them efficiently in your code. You can take this quiz after reading the Lists vs Tuples in Python tutorial. The quiz contains 10 questions and there is no time limit. You’ll get 1 point […]

Read more

Using Pydantic to Simplify Python Data Validation

Pydantic is a powerful data validation and settings management library for Python, engineered to enhance the robustness and reliability of your codebase. From basic tasks, such as checking whether a variable is an integer, to more complex tasks, like ensuring highly-nested dictionary keys and values have the correct data types, Pydantic can handle just about any data validation scenario with minimal boilerplate code. In this video course, you’ll learn how to: Work with data schemas with Pydantic’s BaseModel Write custom […]

Read more

Quiz: How to Use Conditional Expressions With NumPy where()

Interactive Quiz ⋅ 10 QuestionsBy Ian Eyre Share In this quiz, you’ll test your understanding of How to Use Conditional Expressions With NumPy where(). By working through the questions, you’ll consolidate the knowledge you gained from the tutorial and take yourself beyond what you learned. To answer some of the questions, you’ll need to do some research outside of the tutorial itself. Embrace this challenge because exploration can take you on a valuable learning journey. The quiz contains 10 questions […]

Read more

Quiz: Generate Images With DALL·E and the OpenAI API

Interactive Quiz ⋅ 9 QuestionsBy Martin Breuss Share In this quiz, you’ll test your understanding of generating images with DALL·E by OpenAI API using Python. By working through this quiz, you’ll revisit how to use the OpenAI Python library, make API calls related to image generation, create images from text prompts, create variations of an image, and convert Base64 strings to PNG image files. The quiz contains 9 questions and there is no time limit. You’ll get 1 point for […]

Read more

Generate Images With DALL·E and the OpenAI API

Describe any image, then let a computer create it for you. What sounded futuristic only a few years ago has become reality with advances in neural networks and latent diffusion models (LDM). DALL·E by OpenAI has made a splash through the amazing generative art and realistic images that people create with it. OpenAI allows access to DALL·E through their API, which means that you can incorporate its functionality into your Python applications. You’ll need some experience with Python, JSON, and […]

Read more
1 5 6 7 8 9 181