Question: Please help me to correct it with python [ 8 8 ] : import random def displaymatrix ( n ) : matrix = [ [

Please help me to correct it with python
[88]: import random
def displaymatrix(n):
matrix =[[random.randint(0,1) for _ in range(n)] for _ in range(n)]
return matrix
def printmatrix(matrix):
for i in range(matrix):
for j in range(matrix):
print(random.randint(0,1), end='')
print()
def main():
size = int(input("Enter the size of the matrix : "))
print(matrix)
if __name__=="__main__":
main()
Enter the size of the matrix : 4
[]
```
Please help me to correct it with python [ 8 8 ]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!