Python Strings


Python string is a data structure that holds list or a string of characters. These characters could be

  1. a single letter
  2. a number
  3. symbol
  4. or special character


The letters are both lowercase and uppercase which we human can understand. The capital 'A' for us is same as lowercase 'a'

The Unicode is a universal IT standard that use hexadecimal letters to represent a single character.

Therefore, we can represent 'A' in Unicode.

\u0041  # represent Unicode A
\u0061  # represent Unicode a

Note that the hexadecimal is a number system to represent decimal numbers using 0 to 9 and A to F. The A to F stands for 10 to 15. Therefore, to total character in hexadecimal is between 0 to 15.


Special Characters

There are characters that does not have symbols. For example, line feed(LF) or carriage return (CR).

The computer start writing or reading from a new line of the text upon receiving these characters.The computer use Unicode characters for these special characters.

There are many special characters in a normal Qwerty keyboard. Here is a list of common characters used in python programming language.

\’single quote
\”double quote
\fform feed(FF)
\nline feed(LF)
\rcarriage return(CR)
\tsingle TAB space
Special characters in python

The rest of the string related topic is discussed in future articles.


Let Us Python – 4th Edition: Python Is Future, Embrace It Fast

This book is for everyone who wish to learn python programming language. It strengthens the foundations, as detailed explanation of programming language concepts are given. Lists down all important points that you need to know related to various topics in an organized manner. Prepares you for coding related interview and theoretical questions. Provides In depth explanation of complex topics and Questions. Focuses on how to think logically to solve a problem. You will learn about Data types, Control flow instructions, console & File Input/output Strings, list & tuples, List comprehension Sets & Dictionaries, Functions & Lambdas Dictionary Comprehension Modules, classes and objects, Inheritance Operator overloading, Exception handling Iterators & Generators, Decorators, and Command-line Parsing