Python Articles

Sorted By: Most Recent
Suraj Gurav Suraj Gurav
Updated on September 22, 2025

An Introduction to the Confusion Matrix in Python

A confusion matrix is a table used to evaluate the performance of a classification model by comparing the predicted labels with the actual labels, showing true positives, true negatives, false positives and false negatives.

Image: Shutterstock / Built In
Satyam Tripathi Satyam Tripathi
Updated on September 22, 2025

How to Fix KeyError Exceptions in Python

KeyError in Python is an exception that occurs when you try to access a key that does not exist in a dictionary.

Image: Shutterstock / Built In
Sohail Hosseini Sohail Hosseini
Updated on September 22, 2025

How to Do a T-Test in Python

A t-test is a statistical test used to determine if there is a significant difference between a sample mean and a hypothesized population mean, or between the means of two independent groups. Here's how to perform a t-test in Python.

Image: Shutterstock / Built In
Daniella Meneses Daniella Meneses
Updated on September 18, 2025

Top 50 Python Interview Questions With Example Answers

Python is one of the most popular computer languages, and developers with skills in it remain in high demand. Here are some of the most common questions you can expect in your next interview.

Image: Shutterstock / Built In
Liu Zuo Lin Liu Zuo Lin
Updated on September 12, 2025

__new__ vs. __init__ Methods in Python

In Python, the __new__ method creates and returns a new object of a class, while the __init__ method initializes the attributes of a newly created object of a class. Learn more about what each does and when to use which.

Image: Shutterstock / Built In
Richmond Alake Richmond Alake
Updated on August 12, 2025

Bubble Sort Time Complexity and Algorithm Explained

Bubble sort time complexity describes how the bubble sort algorithm’s runtime scales with input size, being O(n²) in average and worst cases and O(n) in the best case when optimized.

Image: Shutterstock / Built In
Gianluca Malato Gianluca Malato
Updated on August 01, 2025

An Introduction to the Shapiro-Wilk Test for Normality

The Shapiro-Wilk test is a hypothesis test applied to a sample with the null hypothesis that the sample was generated from a normal distribution.

Image: Shutterstock / Built In
Artem Oppermann Artem Oppermann
Updated on July 31, 2025

What Is Object-Relational Mapping (ORM)?

Object-relational mapping (ORM) is a programming technique that lets developers use object-oriented code to interact with relational databases, by translating objects to and from database-compatible formats.

Image: Shutterstock / Built In
Bisola Olasehinde Bisola Olasehinde
Updated on July 31, 2025

How to Insert a Python Variable in a String

There are four common methods that will allow you to add Python variables in a string, including: the comma, the modulus operator, string format and f-strings. Here’s how they work.

Image: Shutterstock / Built In
Alexander Majorov Alexander Majorov
Updated on July 22, 2025

Python ImportError: Attempted Relative Import With No Known Parent Package Solved

The “ImportError: attempted relative import with no known parent package” occurs when a relative import in a module has no parent package. Here’s how to solve it.

Image: Shutterstock / Built In