Python Program to Find Length of String


Find Length of String using len() function

-

-

Example:

Copied
str = "webisworld"
print("String Length: ", len(str))

Output:

String Length: 10

Find Length of String without using inbuild function

-

-

Example:

Copied
text = "webisworld"

length = 0
while text[length:]:
    length = length+1

print("String Length: ", length)

Output:

String Length: 10