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 will help you in learning.Please leave your comments and suggestions in comment section. if you any doubts please use search box provided right side. Search there for answers thank you.
«
Next
Newer Post
»
Previous
Older Post

No comments

Leave a Reply

Select Menu