Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to run matrix in python

# 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()
Comment

PREVIOUS NEXT
Code Example
Python :: view back of list in python 
Python :: dynamically created queryset for PrimaryKeyRelatedField in drf 
Python :: striding in python 
Python :: python project 
Python :: Python - Comment jouer le fichier Mp3 
Python :: Python - Cara Bermain Mp3 File 
Python :: create schema dynamo revit 
Python :: extract area code from phone number python 
Python :: jpg image in tkinter title 
Python :: last value added odoo 
Python :: clicking items in selenium 
Python :: plot by hour of day pandas 
Python :: django how to delete a db field 
Python :: python enumerate in list comprehension with if statement 
Python :: pandas row printed horizontally 
Python :: delete row by index pandas 
Python :: return tuples form functions in Python 
Python :: task orchestration framework 
Python :: django not detecting new model 
Python :: Install pip and add virtual environment to the Python Kernel 
Python :: change text color in jupyter notebook 
Python :: Sorted iteration 
Python :: color to black and white opencv 
Python :: add halt for 10 seconds in selenium python 
Python :: seaborn plot to see outliers 
Python :: odd or even checker 
Python :: python file write all the bounding box coordinates using opencv 
Python :: how to import the whall library in python 
Python :: how to install python on visual studio code 
Python :: python numpy 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =