NEW
Font size
WorksheetsIntroduction to NumPy (easy)
Total questions: 10
Worksheet time: 5mins
line 1: import numpy as np
line 2: array = ______ ([1,2,3,4,5])
array
FILL IN THE BLANK
np.Array
Line 1: array = np.array([1,2,3,4,5])
Line 2: print(array[2])
What will the code print?
import numpy as np
array = np.array([1,2,3,4,5])
array[1] = 7
print(array)
What does line 3 do?
import numpy as np
array = np.array([1,2,3,4,5])
array[1] = 7
print(array)
What will the code print?
import numpy as np
array = np.array([1,2,3,4,5])
array += 10
print(array)
What does this code print?
import numpy as np
array = np.array([1,2,3,4,5])
sum_all = np.sum(array)
print(sum_all)
What is the result of this code?
import numpy as np
array = np.array([1,2,3,4,5])
sum_all = ______(array)
print(sum_all)
Fill in the blank
np.Sum
np.addition
Line 1: array = np.array([1,2,3,4,5])
Line 2: print(array[___])
The code returns the following:
3
What should be in the blank?
import numpy as np
array = np.array([1,2,3,4,5])
array[__] = 7
print(array)
The code returns this:
[1,2,7,4,5]
What should be in the blank?
import numpy as np
array = np.array([20,30,40,50,60])
sum_all = np.sum,(array)
print(sum_allincluded)
What does the code print?
error
