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)

download android app