Created
October 30, 2021 10:28
-
-
Save naemazam/bfb73f0b152343922258980c4cbe719a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A basic code for matrix input from user | |
R = int(input("Enter the number of rows:")) | |
C = int(input("Enter the number of columns:")) | |
# Initialize matrix | |
matrix = [] | |
print("Enter the entries rowwise:") | |
# For user input | |
for i in range(R): # A for loop for row entries | |
a =[] | |
for j in range(C): # A for loop for column entries | |
a.append(int(input())) | |
matrix.append(a) | |
# For printing the matrix | |
for i in range(R): | |
for j in range(C): | |
print(matrix[i][j], end = "") | |
print() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment