Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

WHAT I AM DOING WRONG (i just want to find prime numbers in matrix)

+1 vote
asked Apr 3 by Lilit (160 points)

lst1=[ ] lst2=[ ] import numpy as np n=3 m=3 mat=np.random.randint(10, size=(n,m)) print(mat) for i in range(n): for j in range(m): for a in range(2, mat[i][j]): if mat[i][j]%a!=0: lst2.append(mat[i][j]) break print(lst2)

1 Answer

0 votes
answered Apr 9 by Peter Minarik (63,180 points)

See the answer in your original post, of which, this is a duplicate.

Please, lock/close this thread.

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...