Duplicate Question
The question on this page has been marked as a duplicate question.
Original Question
Which line of code will correctly create an array? (Assume numpy has already been imported.) (1 point) Responses myScores = num...Asked by jeff
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
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
Answers
There are no human answers yet.
Answered by
GPT-4o mini
The correct line of code that will create a numpy array is:
```python
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.
```python
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.
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.