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.

  1. string="america"
  2. print(len(string))
Output: 7


Instance Of Java

We are here to help you learn! Feel free to leave your comments and suggestions in the comment section. If you have any doubts, use the search box on the right to find answers. Thank you! 😊
«
Next
Newer Post
»
Previous
Older Post

No comments

Leave a Reply

Select Menu