Str.encode will return encode string in different given codecs.
Syntax of Str.encode:
encode(encoding=’utf-8′, errors=’strict’)
encoding format can any of the codecs in python utf8,utf32,cp273 etc.
In example given below it encodes string in utf32 format.
[…] 5.Str.encode:It Returns encodes version of string if not mentioned then in UTF 8 standard. […]