본문 바로가기
Computer Science/[20-4] Numpy 연습

[Numpy] (4) Zeros and Ones

by gojw 2020. 4. 1.

HackerRank 문제: https://www.hackerrank.com/challenges/np-zeros-and-ones/problem

 

Zeros and Ones | HackerRank

Print an array using the zeros and ones tools in the NumPy module.

www.hackerrank.com

import numpy as np

num = tuple(map(int, input().split(' ')))

print(np.zeros(num, dtype=int))
print(np.ones(num, dtype=int))

 

댓글