The correct line of code to create an array is:
myScores = numpy.array([98, 87, 89, 92])
This option is repeated twice among the choices, both of which are correct. The other provided options use incorrect syntax for creating a NumPy array.
Which line of code will correctly create an array? (Assume numpy has already been imported.)
(1 point)
Responses
myScores = numpy.array([98, 87, 89, 92])
myScores = numpy.array([98, 87, 89, 92])
myScores = numpy.array(98, 87, 89, 92)
myScores = numpy.array(98, 87, 89, 92)
myScores = numpy.array[(98, 87, 89, 92)]
myScores = numpy.array[(98, 87, 89, 92)]
myScores = numpy.array{98, 87, 89, 92}
myScores = numpy.array{98, 87, 89, 92}
Skip to navigation
1 answer
The correct line of code to create an array is:
myScores = numpy.array([98, 87, 89, 92])
This option is repeated twice among the choices, both of which are correct. The other provided options use incorrect syntax for creating a NumPy array.