In Python, type of behavior will not change for data type. Below example is list containing integer type in string.so, we have to take all int type numbers from list even it is declared in string.
Input : list1 = [12, 'geek', 2, '41', 'for', 10, '8', 6, 4, 'geeks', 7, '10'] Output : 100 Input : list1 = [100, 'geek', 200, '400', 'for', 101, '2018', 64, 74, 'geeks', 27, '7810'] Output :10794
- Python | Convert list of string to list of list
- Python | Convert list of string into sorted list of integer
- Python | Convert list of numerical string to list of Integers
- Python | Convert string enclosed list to list
- Python | Convert a string representation of list into list
- Python | Check if given string can be formed by concatenating string elements of list
- Python | First Non-Empty String in list
- Python | Categorize the given list by string size
- Python | Split string into list of characters
- Python | Insert value after each k letters in given list of string
- Python | Splitting string to list of characters
- Python | Splitting list on empty string
- Python | Test if string contains element from list
- Python | Converting list string to dictionary
- Python | Convert a list of characters into a string
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.