Q:

Write a NumPy program to create a null vector of size 10 and update sixth value to 11

0

Write a NumPy program to create a null vector of size 10 and update sixth value to 11

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

import numpy as np
x = np.zeros(10)
print(x)
print("Update sixth value to 11")
x[6] = 11
print(x)

Sample Output:

[ 0.  0.  0.  0.  0.  0.  0.  0.  0.  0.]                               
Update sixth value to 11                                                
[  0.   0.   0.   0.   0.   0.  11.   0.   0.   0.]

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now