What will the expression `len("Hello")` return?

Master Python with the PCAP Certification! Explore interactive quizzes and detailed explanations to ensure your exam success. Gain confidence and get certified!

The expression len("Hello") returns 5 because the len() function in Python calculates the number of characters in a given string. In this case, the string "Hello" consists of five characters: 'H', 'e', 'l', 'l', and 'o'. Thus, applying the len() function to this string provides the accurate length, which is 5. The other options do not correctly represent the character count in the string "Hello", as they suggest lengths that are either too short or undefined.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy