Python Algorithms Articles

Sorted By: Most Recent
Yang Zhou Yang Zhou
Updated on July 15, 2024

Python: 5 Ways to List Files in Directory

In this tutorial, you will learn 5 ways in Python to list all files in a specific directory. Methods include os.listdir(), os.walk(), the glob module and more.

Image: Shutterstock / Built In
Reza Lavarian Reza Lavarian
Updated on July 11, 2024

How to Fix TypeError: ‘List’ Object Is Not Callable in Python

TypeError: ‘list’ object is not callable is an error in Python that’s caused when a list is thrown as if it was a function. Here’s how to fix it.

Image: Shutterstock / Built In
Giorgos Myrianthous Giorgos Myrianthous
Updated on July 08, 2024

Understanding Duck Typing in Python

Duck typing in Python is a term used to illustrate that code will execute an action based on the types of built-in objects being processed. Here’s what to know.  

Image: Shutterstock / Built In
Benedict Neo Benedict Neo
Updated on June 05, 2024

Timing Function in Python: A Guide

You can time Python functions to measure how long it takes for your Python code to run or evaluate the performance of different approaches using time.perf)counter(), time.time() and more. Here’s how.

Image: Shutterstock / Built In
Giorgos Myrianthous Giorgos Myrianthous
Updated on February 21, 2024

What Does “If __name__ == ‘__main__’” Do in Python?

__name__ is a special variable in Python. “If __name__== ‘__main__’” is a conditional statement that tells the Python interpreter under what conditions the main method should be executed.  

Image: Shutterstock / Built In
Seyma Tas Seyma Tas
Updated on February 21, 2024

Garbage Collection and Memory Management in Python

Garbage collection in Python is an automated memory management process that deletes objects when they’re no longer in use. Learn how it works.

Image: Shutterstock / Built In
Yancy Dennis Yancy Dennis
Updated on February 16, 2024

A Guide to HowDoI in Python

HowDoI is a command line utility in Python that allows you to search the internet for answers to programming questions. Here’s how to use it.

Image: Shutterstock / Built In
Harshil Patel Harshil Patel
Updated on December 19, 2023

QuickSort Algorithm: An Overview

QuickSort is a sorting algorithm that uses a divide-and-conquer strategy to split and sort an array. It has a time complexity of O nlogn.

Image: Shutterstock / Built In
Xiaoxu Gao Xiaoxu Gao
Updated on December 06, 2023

How to Write Pythonic Code

Pythonic describes code that doesn’t just get the syntax right but uses the language in the way it’s intended to be used. Here’s how to optimize your Python code.

Image: Shutterstock / Built In
Stephen Gossett Stephen Gossett
Updated on December 01, 2023

22 Python Data Science Courses and Bootcamps to Know

Sorry, R-ficionados. This is Python country.

Image: Shutterstock
Brand Studio Logo