Responsive Navbar with Google Search
☰ Menu
🏠 Home
Python
📄 LaTeX
📊 GNUPlot
💬 Feedback
✉️ Contact
Matrix Operation: Matrix Addition
Matrix Operation
Matrix
Matrix Addition
Matrix Multiplication
Matrix Transpose
Matrix Determinant
Matrix using List Comprehension
Loading Python Environment…
Python runs in your browser. Heavy or infinite loops may freeze your browser tab. Use "Stop" if needed; for heavy jobs, run locally.
Program 1
Matrix Addition
'''Add two matrices''' matrix1 = [ [1, 2, 3], [4, 5, 6], [7, 8, 9] ] matrix2 = [ [9, 8, 7], [6, 5, 4], [3, 2, 1] ] result = [[0, 0, 0], [0, 0, 0], [0, 0, 0]] for i in range(len(matrix1)): for j in range(len(matrix1[0])): result[i][j] = matrix1[i][j] + matrix2[i][j] print(result)
Run
Stop
Output 1