Computer Science, asked by Dharshinikavin, 1 year ago

How many string types does python support? How are they different from one another​

Answers

Answered by reshmisendutta
40

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.

pls mark it as the braliest answer

Answered by Anonymous
6

Explanation:

Python supports two string types, single quoted strings and double quoted strings. They have no particular difference in python

Similar questions