Learn NumPy with this eBook! It covers code examples for all essential functions. Get it for free together with monthly Python tips and news.
A clean way to ask the user for input and catch invalid inputs.
This article shows the difference between append() and extend() for Python Lists.
Learn different ways to concatenate two lists or other iterables in Python.
Learn what's the difference between the __str__ and __repr__ methods in Python.
Learn what's the difference between a class method, a static method, and an instance method in Python.
This article shows how to pad a numeric string with zeroes to the left such that the string has a specific length.
This article shows how a directory and all missing parents of this directory can be created in Python.
This article shows different ways to merge two Dictionaries in Python.
Learn how to run a system command from Python and how to execute another program.
Learn how to check if a String contains a Substring in Python and how to get the position.
Learn how the index of an item in Python Lists can be found.
Find out how to access the index in for loops in Python.
This article presents different ways how to check if a file or a directory exists in Python.
Learn how to remove elements in a List in Python while looping over it. There are a few pitfalls to avoid.
It's good practice to apply this in your scripts. Find out why and how this works.
A while loop is used for iterating over a sequence. This artice shows how to use while loops.
A for loop is used for iterating over a sequence. This artice shows how to use for loops.