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.
Array creation and indexing
Zeros and Ones
Report a typo
Sample Input 1:
8
1Sample 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
0Sample Output 2:
[[0. 0. 0.]
[0. 0. 0.]
[0. 0. 0.]]Write a program in Python 3
import numpy as np
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.