Python String Length
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.
str = 'Core Python' n = len(str) print(n)
Without using built in function
str = 'Core Python' count=0 for i in str: count+=1 print(count)

A Python program to access each element of a string in forward and reverse orders using while loop.
str = 'Core Python' n = len(str) i=0 while i<n: print(str[i], end='') i+=1 print() i=-1 while i>=-n: print(str[i], end='') i-=1 print() i=1 n = len(str) while i<=n: print(str[-i], end='') i+=1
A Python program to access the characters of a string using for loop.
str = 'Core Python' for i in str: print(i, end='') print() for i in str[:: -1]: print(i, end='')