Answer to Question #116234 in Python for jajaksks

Question #116234
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
1
Expert's answer
2020-05-19T09:02:11-0400
#initialize list
nums = [[] for _ in range(6)]


#fill it with numbers
nums[0] = 14
nums[1] = 36
nums[2] = 31
nums[3] = -2
nums[4] = 11
nums[5] = -6


#print list
print(nums)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS