# Python | Strings length summation

• Last Updated : 28 Feb, 2019

Sometimes we receive data in the container that we need to process to handle it further for some essential utility. The magnitude of amount of data sometimes becomes important and needs to be known. This article discusses the total length of list of strings. Let’s discuss certain ways in which this can be done.

Method #1 : Using `sum()` + list comprehension
The combination of these two functions can be used to perform this particular function. The sum function is used to find the summation of each string of list and list comprehension does the task of iteration.

 `# Python3 code to demonstrate``# string lengths summation ``# using sum() + list comprehension`` ` `# initializing list of tuples``test_list ``=` `[``'Geeks'``, ``'for'``, ``'Geeks'``]`` ` `# printing the original list``print` `(``"The original list is : "` `+` `str``(test_list))`` ` `# using sum() + list comprehension``# string lengths summation ``res ``=` `sum``(``len``(i) ``for` `i ``in` `test_list)`` ` `# printing result``print` `(``"The summation of strings is : "` `+` `str``(res))`

Output:

```The original list is : ['Geeks', 'for', 'Geeks']
The summation of strings is : 13
```

Method #2 : Using `join() + len()`
The inbuilt functions of python can help to perform this particular task. The join function can be used to join all the strings together and len function takes their cumulative sum.

 `# Python3 code to demonstrate``# string lengths summation ``# using sum() + list comprehension`` ` `# initializing list of tuples``test_list ``=` `[``'Geeks'``, ``'for'``, ``'Geeks'``]`` ` `# printing the original list``print` `(``"The original list is : "` `+` `str``(test_list))`` ` `# using sum() + list comprehension``# string lengths summation ``res ``=` `len``(''.join(test_list))`` ` `# printing result``print` `(``"The summation of strings is : "` `+` `str``(res))`

Output:

```The original list is : ['Geeks', 'for', 'Geeks']
The summation of strings is : 13
```

My Personal Notes arrow_drop_up