Question DSA-STR-0002
EasyWhat is the output of this code?
print(len("hello"))
- A.
5
- B.
4
- C.
Show answer and explanation
Answer: A
len() counts the characters: h, e, l, l, o.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Strings question
What is the output of this code?
print(len("hello"))
5
4
Answer: A
len() counts the characters: h, e, l, l, o.
6
Error