How many types of strings are supported in python
Asked by admin @ in Computer Science viewed by 355 People
How many string types does python support? How are they different from one another
Asked by admin @ in Computer Science viewed by 355 People
How many string types does python support? How are they different from one another
Answered by admin @
Answer:
Explanation:
There are 2 types of strings supported by python. Strings stored as characters and stored as bytes.
Strings stored as characters are represented as unicode in python 2 or str in python 3. Specifying a unicode string can be done by adding ‘u' before string. Eg u'hello' will be a unicode string.
Strings stored as bytes are represented as str in python 2 or bytes in python 3. Specifying a byte string can be done by adding ‘b' before string. Eg b'hello' will be a byte string.
In case of text formats such as UTF-8, python supports all formats.
Asked by admin @ in Computer Science viewed by 357 persons
Asked by admin @ in Computer Science viewed by 307 persons
Asked by admin @ in Biology viewed by 310 persons
Asked by admin @ in Social Studies viewed by 333 persons
Asked by admin @ in Biology viewed by 270 persons
Asked by admin @ in Health viewed by 289 persons
Asked by admin @ in Computer Science viewed by 287 persons
Asked by admin @ in Computer Science viewed by 356 persons
Asked by admin @ in Computer Science viewed by 949 persons
Asked by admin @ in Social Sciences viewed by 364 persons
Asked by admin @ in Computer Science viewed by 347 persons
Asked by admin @ in Computer Science viewed by 355 persons
Asked by admin @ in Biology viewed by 287 persons
Asked by admin @ in Computer Science viewed by 998 persons
Asked by maham237 @ in Geography viewed by 408 persons
Asked by admin @ in Computer Science viewed by 19016 persons
Asked by admin @ in Computer Science viewed by 15796 persons
Asked by admin @ in Computer Science viewed by 10964 persons
Asked by admin @ in Computer Science viewed by 10397 persons
Asked by admin @ in Computer Science viewed by 8127 persons
Asked by admin @ in Computer Science viewed by 7837 persons
Asked by admin @ in Computer Science viewed by 6481 persons
Asked by admin @ in Computer Science viewed by 5785 persons
Asked by admin @ in Computer Science viewed by 5684 persons
Asked by admin @ in Computer Science viewed by 5471 persons
Asked by admin @ in Computer Science viewed by 4977 persons
Asked by admin @ in Computer Science viewed by 4968 persons
Asked by admin @ in Computer Science viewed by 4680 persons
Asked by admin @ in Computer Science viewed by 4484 persons