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 a string representation of list into list
- Python | Convert string enclosed list to list
- Python | Check if given string can be formed by concatenating string elements of list
- Python | Check if string ends with any string in given list
- Python | First Non-Empty String in list
- Python | Splitting string to list of characters
- Python | Get the substring from given string using list slicing
- Python | Insert value after each k letters in given list of string
- Python | Categorize the given list by string size
- Python | Converting list string to dictionary
- Python program to convert a list to string
- Python | Splitting list on empty 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.