HackerRank- Python Shape and Reshape

Given a space separated list of nine integers. Your task is to convert this list into a 3X3 NumPy array.

  1. import numpy as np
  2. a=np.array(list(map(int,input().split())))
  3. a.shape=(3,3)
  4. print(a)


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