Posts From Python String

Strings – you use it in every program, just like any other programming language. Learn about Strings in Python and how to manipulate them in the Pythonic way.

String Formatting Title

String Formatting in Python – A Quick Overview

String formatting, as the name suggests, refers to the multiple ways to format strings in Python. In this tutorial, we will discuss the different ways and how to use them. What is String Formatting? Let us say you are writing a program that prints the square of a number. In your input, you get an […]

Single Vs Double Quotation Marks

Difference Between Single and Double Quotes in Python

A String is a sequence of characters. You are allowed to start and end a string literal with single and double quotes in Python. There are two ways to represent a string in python programming. In this article, you will see the difference between both the quotation marks with the help of an example i.e. code with […]

Ways To Extract Digits From A String

2 Easy Ways to Extract Digits from a Python String

Hello, readers! In this article, we will be focusing on the ways to extract digits from a Python String. So, let us get started. 1. Making use of isdigit() function to extract digits from a Python string Python provides us with string.isdigit() to check for the presence of digits in a string. Python isdigit() function […]

Strings In Python

Strings in Python – The Complete Reference

Strings in Python are amongst the widely used data types and are created by enclosing characters in quotes. For example: Strings are enclosed within single quotes or double-quotes. Both of these are considered as strings by the interpreter. Python does not support the ‘character’ datatype but support strings of length one. For example: How to […]

Python Raw Strings

How to use Python Raw Strings?

Hello everyone! In this article, we’ll be looking at how we can use Python raw strings. This is a powerful feature of Python, using which we can introduce “raw-strings”, without escaping any characters. A Python raw string is a normal string, prefixed with a r or R. This treats characters such as backslash (‘\’) as […]

Python String Format Map

Using Python String format_map()

In this article, we’ll take a look at thePython String format_map() method. This method returns a formatted version of the string using a map-based substitution, using curly brackets {}. Let’s understand this properly, using a few examples. Basics of Python String format_map() The Python String format_map() function is available from Python 3.2 onward, so make […]