Strings and Bytes¶
Strings contain a sequence of characters aka. text [1].
output = "Hello World"
type(output)
Since Python 3 Unicode is used for representing the characters.
Before they were just bytes in the memory [2]. Therefore Python 3 introduced the bytes type for being able to handle binary data too.
output = "Hello Wörld" # Unicode (contains a German umlaut)
type(output)
output = b"abc"
type(output)
output = b"Hello Wörld" # will raise an Exception