Computer Science for IGCSE & O level - Programming (Section 2 - No. 6)

What is the function of the `len()` method in Python (or equivalent in other languages, like 'length' in some)?
To find the largest value in a string.
To calculate the sum of numbers in a string.
To determine the number of characters in a string or elements in a list.
To convert a string to lowercase.

Explanation

The len() method (or its equivalent) returns the length of a sequence.

Comments (0)

Advertisement