KnowledgeBoat Logo
|

Robotics & Artificial Intelligence

Which of the following string operators in Python is used to find the length of a string 'a'?

  1. len(a)
  2. len()
  3. a.len()
  4. a.len(a)

Python String Manipulation

1 Like

Answer

len(a)

Reason — The function len() is used to find the number of characters in a string. When the string a is passed as an argument, len(a) returns its length.

Answered By

1 Like


Related Questions