Python Practice › String Programs › Program 27
Length of a string
Write a Python program to calculate the length of a string.
Input
"python"
Output
6
Approach
- Use
len().
Solution
print(len("python"))Output
6
Learn the concept
New to this topic? Read the lesson, then come back.