Home >>Python Built-in Functions >Python len() Function
Python len() function is used to return the number of items in a given input object. If the object is a string then len() function will return the number of characters in the string.
Syntax:len(object)
Parameter | Description |
---|---|
object | This is a required parameter. It defines the given object. |
mylist = ["apple", "orange", "mango", "orange"]
x = len(mylist)
print(x)
x = len("PHPTPOINT")
print(x)