HackerRank- Python Transpose and Flatten




Print the transpose and flatten results.



  1. import numpy
  2. n, m = map(int, input().split())
  3. array = numpy.array([input().strip().split() for _ in range(n)], int)
  4. print (array.transpose())
  5. print (array.flatten())




codesadda.com

Codesadda.com is your home of programming solutions, tutorials, video tutorials and much more. Sign Up for our weekly newsletter to get update about new content.

Like us on Facebook | Connect with us on LinkedIn | Subscribe our Channel on Youtube