- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

# Python – Convert Integer Matrix to String Matrix

When it is required to convert an integer matrix to a string matrix, a list comprehension is used.

## Example

Below is a demonstration of the same −

my_list = [[14, 25, 17], [40, 28, 13], [59, 44, 66], [29, 33, 16]] print("The list is :") print(my_list) my_result = [[str(element) for element in index]for index in my_list] print("The reuslt is :") print(my_result)

## Output

The list is : [[14, 25, 17], [40, 28, 13], [59, 44, 66], [29, 33, 16]] The reuslt is : [['14', '25', '17'], ['40', '28', '13'], ['59', '44', '66'], ['29', '33', '16']]

## Explanation

A list is defined and displayed on the console.

A list comprehension is used to iterate over the list, and every element is converted to string and is stored in a list.

This result is assigned to a variable.

This is the output that is displayed on the console.

- Related Questions & Answers
- Python - To Convert Matrix to String
- Python Program to Convert Matrix to String
- Python – Convert String to matrix having K characters per row
- How to convert a matrix to binary matrix in R?
- Python Program – Convert String to matrix having K characters per row
- How to plot a confusion matrix with string axis rather than integer in Python?
- Program to convert given Matrix to a Diagonal Matrix in C++
- How to convert a binary matrix to logical matrix in R?
- Python program to Convert Matrix to Dictionary Value List
- How to convert a sparse matrix into a matrix in R?
- How to convert a matrix into a color matrix in R?
- Minimum Number of Flips to Convert Binary Matrix to Zero Matrix in C++
- How to convert String to Integer and Integer to String in Java?
- How to convert Python DateTime string into integer milliseconds?
- Convert a single column matrix into a diagonal matrix in R.

Advertisements