Zeros and Ones

Report a typo

The input contains two integers. The first one is a number of rows and columns in the two-dimensional square array that you should create. The second one is an integer to fill your array, zero or one. Print the array.

Sample Input 1:

8
1

Sample Output 1:

[[1. 1. 1. 1. 1. 1. 1. 1.]
 [1. 1. 1. 1. 1. 1. 1. 1.]
 [1. 1. 1. 1. 1. 1. 1. 1.]
 [1. 1. 1. 1. 1. 1. 1. 1.]
 [1. 1. 1. 1. 1. 1. 1. 1.]
 [1. 1. 1. 1. 1. 1. 1. 1.]
 [1. 1. 1. 1. 1. 1. 1. 1.]
 [1. 1. 1. 1. 1. 1. 1. 1.]]

Sample Input 2:

3
0

Sample Output 2:

[[0. 0. 0.]
 [0. 0. 0.]
 [0. 0. 0.]]
Write a program in Python 3
import numpy as np
___

Create a free account to access the full topic