Home >Backend Development >Python Tutorial >Usage of len() in python
Recommended tutorial: Python tutorial
Function: len ()
#Return the length of string, list, dictionary, tuple, etc.
Syntax: len(str)
str: String, list, dictionary, tuple, etc. to be calculated
Return value : The length of elements such as strings, lists, dictionaries, and tuples.
Test:
1: Calculate the length of the string
2: Calculate the length of the array
3: Calculate the length of the dictionary
The above is the detailed content of Usage of len() in python. For more information, please follow other related articles on the PHP Chinese website!