Computer Science, asked by armanmahi9657, 11 months ago

How are the string type different from one another?

Answers

Answered by oOMimosaoO
1

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.

Similar questions