8.6 Code Practice: Question 2
Copy and paste your code from the previous code practice. If you did not successfully complete it yet, please do that first before 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.

Answers

Answer 1

Answer:

import random

def buildArray():

   amount = int(input("How many values to add to the array: "))

   array = []

   for i in range(amount):

       array.append(random.randint(10, 99))  

   return array

array = buildArray()

print(array)

def sumArray(array):

   return sum(array)

sum_array = sumArray(array)

print("The total is: ", sum_array)

Explanation:

this gave me 80%

Answer 2

In this exercise we have to use the knowledge of computational language in python to write the code.

We have the code in the attached image.

The code in python can be found as:

import random

def buildArray():

  amount = int(input("How many values to add to the array: "))

  array = []

  for i in range(amount):

      array.append(random.randint(10, 99))  

  return array

array = buildArray()

print(array)

def sumArray(array):

  return sum(array)

sum_array = sumArray(array)

print("The total is: ", sum_array)

See more about python at brainly.com/question/26104476

8.6 Code Practice: Question 2Copy And Paste Your Code From The Previous Code Practice. If You Did Not
8.6 Code Practice: Question 2Copy And Paste Your Code From The Previous Code Practice. If You Did Not

Related Questions

PLEASE HELPPPPPPP What should you always disconnect before installing hardware inside a computer’s case?

A.
all cabling
B.
all internal components
C.
the CPU
D.
the internal DVD drive

Answers

Answer:

a) all cabling hope it helps

What should a user do to find and replace text throughout a field? Use the drop-down menus to complete the steps
1. Put the cursor in the field to search
2. In the Home tab, open the dialog box
3. On the
tab, enter the text to search for and the replacement text
4. After a few instances to make sure the text is being replaced correctly, you can then click
to
change all instances

Answers

The thing that a user should do to find and replace text throughout a field  are:

1. Put the cursor in the field to search.

2. Open the  find  dialog box.

3. On the Replace tab, enter the text to search for and the replacement text.

4. Click  Replace All  to change all instances.

How do you search for and replace text across an entire field?

The keys on the keyboard CTRL+F is often used  to find. The dialog window for Find and Replace appears. Click the Find tab in the Find and Replace dialog box to search for data. Click the Replace tab to perform a find-and-replace operation.

The operations are:

1. Click Find and Select in the Editing group on the Home tab, then select Replace from the drop-down list.

2. In the dialog box, select the objects you want to Find and Replace by clicking the Options button.

3. Press the Replace or Replace All button.

Therefore, If you want to replace all occurrences of a word or format in a document, use the Ctrl+H Find and Replace function. This is very useful for lengthy papers.

Learn more about Editing  from

https://brainly.com/question/15768529
#SPJ1

See full question below

What are the steps to replace one piece of text with another throughout a field? Use the drop-down menus to

complete the statements.

1. Put the cursor in the field to search.

2. Open the _____

dialog box.

3. On the Replace tab, enter the text to search for and the replacement text.

4. Click -------to change all instances.

Why do we use if statements?



To tell Tracy to stop our code if there’s an error


To have Tracy make decisions based on conditional statements


To tell Tracy to do something if we run our code


To have Tracy complete one function at a time

Answers

answer is 2 i’m pretty sure

I need help I have questions I need answers in coding html,css,js and python.Fast
The purpose of the sleep method is to reduce the amount of energy the program uses.
True
False
The _____ is a collection of webpages that use the internet.
pseudocode
World Wide Web
Python
server
Which of the following lines of code would correctly create a list called weapons?
weapons == [“sword”, “sling”, “knife”]
weapons = [“sword” or “sling” or “knife”]
weapons = (“sword”, “sling”, “knife”)
weapons = [“sword”, “sling”, “knife”]
Which of these lines of code would import both the random and the time modules?
import random, time
import random and time
time.import, random.import
import(random, time)
When using HTML, your text should be placed between the opening and the closing tags.
True
False

Answers

Answer:

1. True

2. World Wide Web

3. weapons = [“sword”, “sling”, “knife”]

4. import random, time

5. True.

Explanation:

For number 1  I'm not quite sure since I never personally used it, but it does reduce CPU usage when activated so it's very possible it's true.

--concept mapping--
importance of trees for people:
1.
2.
3.
4.
5.
importance of trees for animals
1.
2.
3.
4.
5.​

Answers

Answer:

-Both need oxygen from the trees to breathe

-Without trees the population of animals and people would be dying

Explanation:

Thats all I can think of

when should a computer definitely have an ip address

Answers

What do you mean they all come with ip once you buy it
There are two types of IP addresses. PUBLIC IP is assigned by the ISP and PRIVATE IP address provided by your Router. When you are connected to network you definitely should have an IP address.

what is the best free website to learn phyton programming

Answers

That is something you should may research on with yourself! Don’t accept a link
From strangers it’s preferred to find one that best suits you!

Use the drop-down tool to select the word or phrase that completes each sentence. Text within a document that is linked to other information available to the reader is called _______. A unique location for a computer on the network is its _______. The ________ is the ability of a network tor cover after any type of failure. The computer that responds to requests from the client computer is known as the ________. A ________ is an ordered list of tasks waiting to be performed.

Answers

Answer:

1. Hyperlink

2. IP address

3. Fault tolerance

4. Server

5. To do list

Explanation:

Text within a document that is linked to other information available to the reader is called HYPERLINK.

A unique location for a computer on the network is its IP ADDRESS.

The FAULT TOLERANCE is the ability of a network to cover after any type of failure.

The computer that responds to requests from the client computer is known as the SERVER.

A TO-DO LIST is an ordered list of tasks waiting to be performed.

Answer:

hypertext

IP address

fault tolerance

server

queue

Explanation:

just did it on edg

Other Questions
Examine the following graph, which contains two parabolas. P(x) is a parabola that opens downward with a vertex at (2,6). It is the graph of the quadratic function P(x)=12(x+2)2+6, and it represents the preimage for a transformation. I(x) is a parabola that opens downward with its vertex at (7,2). It is the image of the transformation.( The One Marked RED IS WRONG ) theoretical probability of drawing an 'N' tile?What is the experimental probability of drawing an N tile? Put the verbs in pass compose and make it into a negative sentence Simplify by combining like terms:8 + 10a 3 + 5a Read this stanza from "The Raven" by Edgar Allan Poe.Once upon a midnight dreary, while I pondered, weak and weary,Over many a quaint and curious volume of forgotten loreWhile I nodded, nearly napping, suddenly there came a tapping,As of some one gently rapping, rapping at my chamber door."'Tis some visitor," I muttered, "tapping at my chamber doorOnly this and nothing more."How does what happens in this stanza propel the action in the poem?It establishes why Lenore has left the speaker alone.It gives the speaker a reason to speak to the raven.It resolves the main conflict of the story.It introduces the story and sets up the coming events. Can someone pls help meeee??!! you don't have to do all just a couple (like 3) ty!! (there's some notes also btw...if that helps) Name three organelles and explain the function of each.this is more sciencegiving 15 points please help me need answers Answer these questions ASAP please and thank you. Higher temperatures tend to increase the rate of a chemical reaction because a. the particles have greater momentum and therefore have higher energy collisions. b. the particles are more likely to behave as a catalyst and lower the activation energy. c. the particles move faster and therefore collide more often. d. the particles have greater attractions and therefore collide with the correct orientation. Help please!! try to explain if you can !! Help asap!!!! :0 Its due in 3 hrs!!! An angle is 22 degrees smaller than a second angle. The two angles are complementary. What is the measure of the smaller angle? Scenario 1: Which states would get you to 270 the fastest?List the states and the number of votes you used in this scenario I need help on 1 and 2 PLS HELP DUE TODAY (show work pls) i only have one attempt left Need Coordinates to triangle DEF I need help ASAP!!!!!!!!!!! 20.Which of the following best explainswhy the white population of theOregon Territory grew tremendouslyfollowing the Lewis and ClarkExpedition?A. No human being had ever livedthere before.B. Whites wanted to leave the Southafter the EmancipationProclamation.C. The territory featured availableland and gold and settlers wereinspired to go west.D. Railroads had not yet beeninvented. Apply the property from the previous step to isolate the variable term.