length of the string:
- The len() function gives the length of the string.
- As it returns the result in integer type.
- It takes the string as the parameter.
- We can use len() for list,tuple,set,dictionry.
- The len() is the built-in function in python programming.
- Example: "string" its length is 6.
Syntax: str(length)
#write a python program to demonstrate the length of the string.
- string="america"
- print(len(string))
Output: 7
No comments