Len ( programming ) - wikipedia Len ( programming ) This article does not cite any sources. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed. ( December 2009 ) In computer programs, len is the name of one of the major string functions. It stands for length, and returns the length of a specific string. Many common programming languages operate on strings using string functions. It is named len in the language BASIC and its derivatives such as Visual Basic. It is named strlen in the language C and its derivatives such as PHP. In some other languages, the full word length is written out as the name of the function. For other languages see Comparison of programming languages ( string functions ). Contents 1 Use in other languages 2 Use in Visual Basic 3 Use in Python 4 Use in Go Use in other languages To see a list of uses in other languages see the length section in Main article : Comparison of programming languages ( string functions ) Use in Visual Basic In Visual Basic, the prototype of the Len function is this : Function Len ( ByVal Str As String ) An example below shows an example of the use of Len function. Sub Main ( ) Dim Str As String Dim Int As Integer Str = InputBox ( `` Enter a string '' ) Int = Len ( Str ) MsgBox ( CStr ( Int ) ) End Sub This function reads a string from an input box and outputs its length. For example, the input `` Hello ! '' will output 6. Use in python The Wikibook Python Programming has a page on the topic of : Strings in Python In Python, len ( ) can be used to denote the length of a string : > > > something = ' Wikipedia ' > > > len ( something ) 9 where the word `` Wikipedia '' clearly has 9 letters. Consider also the example of `` I am John '' > > > len ( ' I am John ' ) 9 because `` I am John '' clearly has 9 characters ( keep in mind that spaces are counted as well ). The Wikibook Python Programming has a page on the topic of : Lists in Python The function len ( ) can also be used to find the size ( i.e. number of elements ) of lists, tuples, dictionaries, sets, and other sequence types ( any object that implements a __len__ ( ) method can be used ). Here the list p includes 3 entries : > > > p = ( ' Wikipedia ', ' Wiktionary ', ' Wikibooks ' ) > > > len ( p ) 3 Use in Go In Go, len ( ) can be used to obtain the length of a string, array, or slice, the number of keys in a map, or the number of elements queued in a channel. Retrieved from `` https://en.wikipedia.org/w/index.php?title=Len_(programming)&oldid=671385453 '' Categories : BASIC commands Hidden categories : Articles lacking sources from December 2009 All articles lacking sources Talk Contents About Wikipedia Add links This page was last edited on 14 July 2015, at 10 : 45 ( UTC ). About Wikipedia

Question: what does the len function do in python
Answer: to denote the length of a string