Question #114361

Instructions

Write a program that uses an initializer list to store the following set of numbers in an array named nums. Then, print the array.


14 36 31 -2 11 -6

Expert's answer

import numpy as np


nums_list = list([14, 36, 31, -2, 11, -6])

print(nums_list)

print(type(nums_list))


nums = np.asarray(nums_list)

print(nums)

print(type(nums))


LATEST TUTORIALS
APPROVED BY CLIENTS