The count() method in Python String returns the number of occurrences of substring sub in the range [start, end]. Optional arguments start and end are interpreted as in slice notation.
#!/usr/bin/python Str = "this is string example....wow!!!"; Str = Str.encode('base64','strict'); print "Encoded String: " + Str print "Decoded String: " + Str.decode('base64','strict')
Encoded String: dGhpcyBpcyBzdHJpbmcgZXhhbXBsZS4uLi53b3chISE= Decoded String: this is string example....wow!!!
Here at Intellinuts, we have created a complete Python tutorial for Beginners to get started in Python.