Python Practice › String Programs › Program 27

Length of a string

EasyString Programs · 27 of 106

Write a Python program to calculate the length of a string.

Advertisement
Input
"python"
Output
6

Approach

  1. Use len().

Solution

Python
print(len("python"))
Output
6
Advertisement

Learn the concept

New to this topic? Read the lesson, then come back.

More string programs

← All 106 String Programs