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.
- import numpy as np
- a=np.array(list(map(int,input().split())))
- a.shape=(3,3)
- print(a)
Given a space separated list of nine integers. Your task is to convert this list into a 3X3 NumPy array.
- import numpy as np
- a=np.array(list(map(int,input().split())))
- a.shape=(3,3)
- 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.