In this tutorial, you’ll learn how to use Python to check if a string contains another substring. There are a number of ways to use Python to check a string for a substring, including case insensitivity, checking for patterns, and… Read More »Python String Contains: Check if a String Contains a Substring
In this tutorial, you’ll learn how to use Python to check if a string is empty or not. Being able to work with strings and see whether or not they are empty is an important skill to learn. Python strings… Read More »How to Check if a String is Empty in Python
In this tutorial, you’ll learn how to use the Python new line character and how to print without newlines. Being able to control how your program prints strings is an important skill, especially when working with text files or command-line… Read More »Python New Line and How to Print Without Newline
In this tutorial, you’ll learn how to use Python to concatenate strings. Being able to work with strings in Python is an important skill in almost every program you’ll write. In some cases, you’ll want to display text in your… Read More »How to Concatenate Strings in Python: A Complete Guide
In this tutorial, you’ll learn how to use the built-in Python map() function. This function allows you to process and transform, or “map”, items in an iterable without needing to use a loop to iterate. The function allows you to… Read More »Python map Function: Transforming Iterables without Loops
In this tutorial, you’ll learn how to use Python to count the number of words and word frequencies in both a string and a text file. Being able to count words and word frequencies is a useful skill. For example,… Read More »Python: Count Words in a String or File
In this tutorial, you’ll learn how to use Python to make a list of the entire alphabet. This can be quite useful when you’re working on interview assignments or in programming competitions. You’ll learn how to use the string module… Read More »How to Make a List of the Alphabet in Python
In this tutorial, you’ll learn how to use the Python ord and chr functions to allow you to work better with Unicode. You’ll learn a quick refresher on Unicode and how string characters can be represented in different ways in… Read More »Python Ord and Chr Functions: Working with Unicode
Learn how to use Python to concatenate a string and an int, including how to use the string function, f-strings, % and +, and format.
Learn how to use Python to sort a string including how to sort strings using the sorted function, with case sensitivity or insensitivity.
In this tutorial, you’ll learn how to use Python’s zfill method to pad a string with leadering zeroes. You’ll learn how the method works and how to zero pad a string and a number. You’ll also learn how to use… Read More »Python zfill & rjust: Pad a String in Python