Skip to content

Blog

How to Select Random Items from a List in Python Cover Image

Python: Select Random Element from a List

Learn how to use Python to choose a random list element, with and without replacement and how to replicate results with a random seed.

Python Check if File Directory Exists Cover Image

Python: Check if a File or Directory Exists

Learn how to use Python to check if a file or a directory exists, using the pathlib and os libraries, including writing conditional checks.

Python Sort String with Sorted Cover image

Python: Sort a String (4 Different Ways)

Learn how to use Python to sort a string including how to sort strings using the sorted function, with case sensitivity or insensitivity.

Python Append to a Tuple Cover Image

Python: Append to a Tuple (3 Easy Ways)

Learn how to use Python to append to a tuple, including tuple concatenation, list conversion, and tuple unpacking in this tutorial.