WAP in Python to create a list of Strings and print the length of
individual elements(strings) of the list.
Answers
Answered by
3
We initialize a list 'l' at the beginning for the strings to be stored into. We then start a loop to retrieve the input from the user, and we add a condition to end the loop in case the user wants to input a limited number of strings. Once the strings have been appended to the list, we start another loop to calculate the length of each element in the list using the len() function, which is used to calculate and return the number of characters, or rather, as per the question, the length of the element.
Similar questions
Math,
5 hours ago
Business Studies,
5 hours ago
Hindi,
5 hours ago
English,
10 hours ago
Math,
7 months ago