Python Program to convert List of Integer to List of String

Given a List of Integers. The task is to convert them to List of Strings.

Examples:

Input: [1, 12, 15, 21, 131]
Output: ['1', '12', '15', '21', '131']

Input: [0, 1, 11, 15, 58]
Output: ['0', '1', '11', '15', '58']

Method 1: Using map()



filter_none

edit
close

play_arrow

link
brightness_4
code

# Python code to convert list of 
# string into sorted list of integer 
    
# List initialization 
list_int = [1, 12, 15, 21, 131]
    
# mapping 
list_string = map(str, list_int) 
    
# Printing sorted list of integers 
print(list(list_string))

chevron_right


Output:

['1', '12', '15', '21', '131']

Example 2: Using list comprehension

filter_none

edit
close

play_arrow

link
brightness_4
code

# Python code to convert list of  
# string into sorted list of integer 
    
# List initialization 
list_string = [1, 12, 15, 21, 131]
    
# Using list comprehension 
output = [str(x) for x in list_string]
    
# Printing output 
print(output)

chevron_right


Output:

['1', '12', '15', '21', '131']

Method 3: Using iteration

filter_none

edit
close

play_arrow

link
brightness_4
code

# Python code to convert list of 
# string into sorted list of integer 
    
# List initialization 
list_string = [1, 12, 15, 21, 131]
    
    
list_int = []
# using iteration and sorted() 
for i in list_string:
    list_int.append(i)
    
# printing output 
print(list_int) 

chevron_right


Output:

['1', '12', '15', '21', '131']



My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. 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.