Answers for "print matrix elemets"

12

print matrix eleme

#Exemple:
M=[[1,2,3],[4,5,6],[7,8,9]]
#Converting Matrix elements to string (join() only work with str Matrix)
M=list(map(lambda i:[str(_) for _ in i],M))
[print(' '.join(i)) for i in M]
Posted by: Guest on April-16-2021

Python Answers by Framework

Browse Popular Code Answers by Language