Python String

Python String encode() decode() — step-by-step Python tutorial on Progressive Robot

Python String encode() decode()

URL: https://www.progressiverobot.com/python-string-encode-decode/ Python String encode() Python string encode() function is used to encode the string using the provided encoding. This function returns the [bytes](/community/tutorials/python-bytes) object. If we don't provide encoding, "utf-8" encoding is used as default. Python Bytes decode() Python bytes decode() function is used to convert bytes to string object. Both these functions allow […]

Read more
Python String Functions — step-by-step Python tutorial on Progressive Robot

Python String Functions

URL: https://www.progressiverobot.com/python-string-functions/ Python provides a lot of built-in functions to manipulate strings. Python String is immutable, so all these functions return a new string and the original string remains unchanged. Python String Functions There are many functions to operate on String. However, it's not feasible to remember all of them. So here I am dividing […]

Read more
Python String isalnum() — step-by-step Python tutorial on Progressive Robot

Python String isalnum()

URL: https://www.progressiverobot.com/python-string-isalnum/ Python string isalnum() function returns True if it's made of alphanumeric characters only. A character is alphanumeric if it's either an alpha or a [number](/community/tutorials/python-numbers). If the string is empty, then isalnum() returns False. !python string isalnum() Python string isalnum() example s = 'HelloWorld2019' print(s.isalnum()) Output: True s = 'Hello World 2019' print(s.isalnum()) […]

Read more
Python String Module — step-by-step Python tutorial on Progressive Robot

Python String Module

URL: https://www.progressiverobot.com/python-string-module/ Python String module contains some constants, utility function, and classes for string manipulation. Python String Module It's a built-in module and we have to import it before using any of its constants and classes. String Module Constants Let's look at the constants defined in the string module. import string # string module constants […]

Read more
Python String replace() — step-by-step Python tutorial on Progressive Robot

Python String replace()

URL: https://www.progressiverobot.com/python-string-replace/ Python string replace() function is used to create a string by replacing some parts of another [string](/community/tutorials/python-string). Python String replace Python String replace() function syntax is: str.replace(old, new[, count]) The original string remains unmodified. The new string is a copy of the original string with all occurrences of substring _old_ replaced by _new_. […]

Read more
How To Work with Unicode in Python — step-by-step Python tutorial on Progressive Robot

How To Work with Unicode in Python

The tutorial will cover the basics of Unicode in Python and how Python interprets Unicode characters. It covers the concepts of unicodedata and how to use this module to convert UTF-8 to ASCII. By the end of this tutorial readers will have a strong fundamental understanding of Unicode in Python which would help solve internationalization problems in code.

Read more
Python f-strings - PEP 498 - Literal String Interpolation — step-by-step Python tutorial on Progressive Robot

Python f-strings – PEP 498 – Literal String Interpolation

URL: https://www.progressiverobot.com/python-f-strings-literal-string-interpolation/ Python f-strings or formatted strings are the new way to format strings. This feature was introduced in Python 3.6 under PEP-498. It's also called literal string interpolation. Why do we need f-strings? Python provides various ways to format a string. Let's quickly look at them and what are the issues they have. % […]

Read more
CHAT