Explore Westonci.ca, the premier Q&A site that helps you find precise answers to your questions, no matter the topic. Connect with professionals ready to provide precise answers to your questions on our comprehensive Q&A platform. Our platform provides a seamless experience for finding reliable answers from a network of experienced professionals.

8.3 code practice edhesive PLEASE HELP AND HURRY
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

Sample Run
[14, 36, 31, -2, 11, -6]

ALSO I DONT NEED A SUM I NEED AN ARRAY

Sagot :

Answer:

numbers = '14 36 31 -2 11 -6'

nums = numbers.split(' ')

for i in range(0, len(nums)):

  nums[i] = int(nums[i])

print(nums)

The program is an illustration of arrays and lists.

Arrays and lists are variables that are used to hold multiply values in one variable

The program in Python, where comments are used to explain each line is as follows:

#This gets input for the list of numbers

numbers = input()

#This splits the numbers into a list

numList = numbers.split(' ')

#This iterates through the list

for i in range(len(numList)):

   #This converts each element to an integer

   numList[i] = int(numList[i])

#This prints the list

print(numList)

Read more about Python lists at:

https://brainly.com/question/24941798

Thanks for stopping by. We are committed to providing the best answers for all your questions. See you again soon. We appreciate your time. Please revisit us for more reliable answers to any questions you may have. Discover more at Westonci.ca. Return for the latest expert answers and updates on various topics.