Question

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 that will create a numpy array is:

myScores = numpy.array([98, 87, 89, 92])

You only need to use numpy.array with square brackets [] to define the list of elements you want to include in the array.

Similar Questions
  1. QuestionWhich line of code will correctly create an array? (Assume numpy has already been imported.) (1 point) Responses
    1. answers icon 1 answer
    1. answers icon 1 answer
    1. answers icon 1 answer
  2. QuestionWhat statement must occur before this line of code? numpy.average(scores) (1 point) Responses import numpy import numpy
    1. answers icon 1 answer
more similar questions