1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
satela [25.4K]
1 year ago
13

Copy and paste your code from the previous code practice. If you did not successfully complete it yet, please do that first befo

re completing this code practice.
After your program has prompted the user for how many values should be in the array, generated those values, and printed the whole list, create and call a new function named sumArray. In this method, accept the array as the parameter. Inside, you should sum together all values and then return that value back to the original method call. Finally, print that sum of values.
Computers and Technology
1 answer:
Gre4nikov [31]1 year ago
4 0

The code practice illustrates the following concepts:

  • Arrays or Lists
  • Methods or Functions

<h3>The program in Python</h3>

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

#This imports the random module

import random

#This defines the sumArray method

def sumArray(myList):

   #This initializes the sum to 0

   isum = 0

   #This iterates through the list

   for i in myList:

       #This adds the array elements

       isum+=i

   #This returns the sum

   return isum

#This gets the number of values    

n = int(input("Number of values: "))

#This initializes the list

myList = []

#This iterates from 0 to n - 1

for i in range(n):

   #This populates the list

   myList.append(random.randint(0,100))

#This prints the list

print(myList)

#This calls the sumArray method

print(sumArray(myList))

   

Read more about Python programs at:

brainly.com/question/24833629

#SPJ1

You might be interested in
To simplify the conceptual design, most higher-order relationships are decomposed into appropriate equivalent _____ relationship
LenaWriter [7]

Answer: binary

Explanation:

Conceptual design refers to the early phase of the design process, whereby the outlines of function are articulated. The conceptual design consist of the design of processes, interactions, and strategies. It is the first stage in the database design process.

The output of the conceptual design process describes the main data entities, and constraints of a particular problem domain. To simplify the conceptual design, most higher-order relationships are decomposed into appropriate equivalent binary relationships whenever possible.

5 0
2 years ago
your friend's parent's are worried about going over their budget for the month. Which expense would you suggest is NOT a need?
Lorico [155]

Answer:

A possible expense that are not a need are entertainment.

I hope this helped!

4 0
2 years ago
What does the coding phase involve?
Harman [31]

Answer:

I do believe it is D im not sure

5 0
2 years ago
Read 2 more answers
During an interview, your _____ can be as influential as your skills and abilities
Leokris [45]
D. All of the above 
your appearance, attitude and image all play a very large role in an interview for a job


8 0
3 years ago
Read 2 more answers
What will happen when a user attempts to login to salesforce from an ip address that is outside the login ip range on the user's
podryga [215]

Answer:

The answer to this question is option "d".

Explanation:

The answer is user will not be able to login at all. The user wants to log in to the salesforce by its IP address. But in the server, all the IP addresses will be registered for their special work. When the user inserting their IP address to log in to the salesforce. The first server will be checking into there database. If IP address doesn't match it will not permit to access salesforce because in their server it is not a valid IP address. It is registered in sever but not for this user.

So the answer to this question is option "d".

7 0
3 years ago
Other questions:
  • Jackie is planning a birthday party for her little brother and is researching different trampoline parks. She receives a pop-up
    12·2 answers
  • Need help this will affect my final grade in technology and the dead line has passed!!!
    11·1 answer
  • Need Help !!! Please
    8·1 answer
  • When using the Internet, it is important to know the validity of web page you are using. How can you know if the information is
    5·1 answer
  • Colin Mackay Inc., a software company with its head office in Amsterdam, has employees across three continents. Certain project
    11·1 answer
  • How are computers used in education and entertainment? List them.​
    10·1 answer
  • In what ways can you modify the location of the neutral point?
    11·1 answer
  • What's the difference between a robot and a machine?
    7·1 answer
  • The arrangement of keys on a keyboard, QWERTY reflects the keyboard layout by ________. Group of answer choices using the letter
    12·1 answer
  • When copper wires are bundled together, they are susceptible to ____________, a form of interference where the signals leak out
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!