How many types of strings are supported in python
Asked by admin @ in Computer Science viewed by 362 People
How many string types does python support? How are they different from one another
Asked by admin @ in Computer Science viewed by 362 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 363 persons
Asked by admin @ in Computer Science viewed by 313 persons
Asked by admin @ in Biology viewed by 320 persons
Asked by admin @ in Social Studies viewed by 343 persons
Asked by admin @ in Biology viewed by 279 persons
Asked by admin @ in Health viewed by 299 persons
Asked by admin @ in Computer Science viewed by 294 persons
Asked by admin @ in Computer Science viewed by 362 persons
Asked by admin @ in Computer Science viewed by 958 persons
Asked by admin @ in Social Sciences viewed by 371 persons
Asked by admin @ in Computer Science viewed by 354 persons
Asked by admin @ in Computer Science viewed by 364 persons
Asked by admin @ in Biology viewed by 295 persons
Asked by admin @ in Computer Science viewed by 1005 persons
Asked by maham237 @ in Geography viewed by 416 persons
Asked by admin @ in Computer Science viewed by 19033 persons
Asked by admin @ in Computer Science viewed by 15819 persons
Asked by admin @ in Computer Science viewed by 10979 persons
Asked by admin @ in Computer Science viewed by 10411 persons
Asked by admin @ in Computer Science viewed by 8147 persons
Asked by admin @ in Computer Science viewed by 7848 persons
Asked by admin @ in Computer Science viewed by 6495 persons
Asked by admin @ in Computer Science viewed by 5798 persons
Asked by admin @ in Computer Science viewed by 5700 persons
Asked by admin @ in Computer Science viewed by 5482 persons
Asked by admin @ in Computer Science viewed by 4988 persons
Asked by admin @ in Computer Science viewed by 4978 persons
Asked by admin @ in Computer Science viewed by 4692 persons
Asked by admin @ in Computer Science viewed by 4494 persons