1. Home
  2. Data Science
  3. Python
  4. What does the 'len' function do?

Added 5 Feb 2024

What does the 'len' function do?

  1. Return the length of a list or string Correct answer
  2. Calculate logarithm
  3. Create a new variable
  4. Convert a value to lowercase

Correct answer

A. Return the length of a list or string

18 views

MCQSEXAM

Explanation

The 'len' function is used to determine the length (number of elements) of a list or the number of characters in a string.

Reference

https://www.w3schools.com/python/python_functions.asp

Doubts & discussion

Not sure why the answer is A? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Python MCQs

Practise all Python MCQs

Similar MCQs