Posts

Showing posts with the label Strings - Data Structures

Python3 Strings DS

Python Data Structures : Strings Strings :              A string is a sequence of characters.   ***Computer do not deal with characters, they deal with numbers (binary) .Even though you may see characters on your screen, internally it is stored and manipulated as a combination of 0's and 1's.        This conversion of character to a number is called encoding, and the reverse process is decoding. ASCII and Unicode are some of the popular encoding used.   *   In python, string is a sequence of Unicode character. How to create a string?      ->   Strings can be created by enclosing characters inside a single quote or double quotes.     ->  Even triple quotes can be used in python but generally used to represent multiline strings and docstrings. Eg:        mystring='Hello'        print(mystring)          mystring="Hello"        print(mystring)        mystring=' ' 'Hello' ' '        print(mystring) output :  Hello                Hello