Length of String

Length of a string represents the number of characters in a string. To know the length of a string, we can use the len() function. This function gives the number of characters including spaces in the string.


Without using built in function


example image for length of string

A Python program to access each element of a string in forward and reverse orders using while loop.

A Python program to access the characters of a string using for loop.