Latest web development tutorials

Python3 len () method

Python3 string Python3 string


description

len () method returns the string length.

grammar

len () method syntax:

len( str )

parameter

  • no.

return value

Returns the string length.

Examples

The following example shows len () to use:

#!/usr/bin/python

str = "w3big example....wow!!!";

print("字符串长度: ", len(str))

Examples of the above output results are as follows:

字符串长度:  24

Python3 string Python3 string