Python String decode() method

The string.decode() method decodes the string using the codec registered for encoding. Default encoding is the current default string encoding. It may raise errors to set a different error handling scheme.

Syntax

Parameter

Encoding: This parameter represents a String specifying the encoding to use. The default value is UTF-8

Errors: This parameter is given to set a different error handling scheme. The default for errors is ‘strict’, meaning that encoding errors raise a UnicodeError. 

Return

This method returns the decoded string.

Example 1

Output

Example 2

Output

Pin It on Pinterest

Share This