Copyright © tutorialspoint.com

Python String len() Method

previous next


Description:

This method returns the length of the string.

Syntax:

len( str )

Parameters:

Here is the detail of parameters:

Return Value:

It returns the length of the string.

Example:

#!/usr/bin/python

str = "this is string example....wow!!!";

print "Length of the string: ", len(str);

This will produce following result:

Length of the string:  32

previous next

Copyright © tutorialspoint.com