Topics

Python String

About this topic: Articles tagged __TAG__

Showing 136 articles

Topics

Articles

Showing 136 articles

How-tos How to Convert Dictionary to String in Python There are 4 main methods that can be used to convert a dictionary to string in Python; the conventional for loop, the str() function, the json module, and the pprint module. How-tos How to Remove Leading Zeros in Python String This tutorial discusses the different ways to remove leading zeros in a Python string. How-tos How to Replace Character in String at Index in Python This tutorial discusses how to replace a character in a string at a certain index in Python. How-tos How to Copy String in Python This tutorial discusses the different ways to to copy a string in Python. How-tos How to Convert String to Decimal in Python This tutorial discusses how to convert a string to a decimal number in Python How-tos How to Split Sentence Into Words in Python The str.split() function can be used to split a sentence into a list of words in Python. How-tos How to Remove Punctuation From Python List We can use the string.punctuation to remove punctuation signs from a list of strings in Python. How-tos How to Find All Indexes of a Character in Python String We can use regular expressions, the yield keyword, and list comprehensions to find all the indexes of a character inside a string in Python. How-tos How to Parse String to List in Python There are 4 main methods that can be used to parse a string representation of a list into an actual list, the str.split(), the str.strip(), the json.loads(), and the … How-tos How to Compare Two Strings Character by Character in Python This article explores several methods to compare two strings character by character in Python, each with its advantages and use cases. How-tos How to Check if Two Strings Are Anagrams Using Python Learn how to check if two strings are anagrams using Python. How-tos How to Check if a String Is a Number in Python This tutorial demonstrates how to check if a string is a number in python. How-tos How to Strip Multiple Characters in Python This tutorial demonstrates how to strip or remove multiple characters from a string object in Python. How-tos How to Fix TypeError: Not Enough Arguments for Format String Error in Python This tutorial discusses the not enough arguments for format string error in Python. How-tos How to Convert List to Comma-Separated String in Python This tutorial discusses how to convert a list to a comma-separated string in Python. How-tos How to Find First Occurrence in a String in Python There are 2 main methods that can be used to find the first occurrence of a substring inside a string in Python: the find() function and the index() function. How-tos How to Get the N-th Occurrence of a Substring in a String in Python We'll discuss several ways to find the nth occurrence of a substring in a string. We have used two python functions, find() and split() and a regular expression method to find to … How-tos How to Split Strings by Tab in Python This tutorial demonstrates how to split strings by tab in Python. How-tos How to Check if a Word Exists in a String in Python This tutorial demonstrates to check if a string contains a specific word using different techniques in Python. How-tos How to Print String to Text File Using Python There are 2 main methods that can be used to write data to a text file in Python, the open() method and the built-in pathlib module. How-tos How to Get Longest Substring Without Repeating Characters in Python This tutorial demonstrates how to create the longest substring without repeating characters in Python. How-tos How to Get Longest Common Substring in Python The article discusses three different approaches to finding the longest common substring between the two given strings in Python. The simplest approach uses three loops and is … How-tos How to Get the Reverse Complement of a DNA Strand Using Python This article discusses how we can create a reverse complement of a DNA strand using Python. It uses the in-built string methods and the Biopython module. How-tos The sprintf() Function in Python This article speaks about the Python sprintf and demonstrates how to format a string using different approaches.

← All topics