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
Ivahew [28]
2 years ago
7

8.6 Code Practice: Question 2

Computers and Technology
1 answer:
Rina8888 [55]2 years ago
4 0

Answer:

import random

def buildArray(a, n):

   for i in range (n):

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

     

arr = []

def sumArray(a):

   tot = 0

   for i in range(len(a)):

       tot = tot + a [i]

   return tot

       

   

arr = []

numbers = int(input("How many values to add to the array:\n"))

buildArray(arr, numbers)

print(arr)

print("Total " + str(sumArray(arr)) )

Explanation:

You might be interested in
MySQL Questions?
Margarita [4]

Answer:

The Statement for selecting values from the table in SQL is given below,

SELECT vendor_name, vendor_contact_last_name, vendor_contact_first_name FROM Vendors;

Explanation:

SQL stands for Structured query language which is used to insert, update, delete and modify the value in a table.

There are five types of SQL-

1. Data definition language  

2. Data manipulation language

3. Data control language

4. Transaction Control Language

5. Data Query Language

The SELECT statement comes under DDL which is used to select and display values from a table.

We can use select statement in two ways-

1. SELECT column_name1, column_name2 ........column_nameN FROM Table_name;

2. SELECT * FROM tablename; ( This is used to select all values from the table name)

We can also give conditions using WHERE clause while selecting values.

6 0
2 years ago
Read 2 more answers
Date:<br>Difference between Chemical Equivalent and Electroche-<br>mical equivalent.​
Sergio039 [100]

Answer:

chemical equivalent of an element is the value obtained by dividing the atomic weigh of the given element by valency

5 0
3 years ago
What type of video games do you prefer buying?
Tamiku [17]
Mine is minecraft maybe
6 0
3 years ago
Call your function from Example 1 three times with different kinds of arguments: a value, a variable, and an expression. Identif
Blizzard [7]

Answer:

Example 1:

def function(num):  

   print(num*2)

Example 2:

function(5)

num = 2

function(num)

function(3-1)

Explanation:

Given:

See attachment for complete question

To start with Example (1)

def function(num):  

   print(num*2)

<em>Note that; the above code segment which doubles the parameter, num could have been any other code</em>

<em />

<em>In Example (1), the parameter is num</em>

For example (2):

We can call the function using:

#1. A value:

function(5)

<em>In #1, the argument is 5; a value</em>

#2. A Variable

num = 2

function(num)

<em>In #2, the argument is num; a variable</em>

#3. An Expression

function(3-1)

<em>In #3, the argument is 3-1; an expression</em>

8 0
3 years ago
What the difference between a samsung and a android​
Vesnalui [34]

Explanation:

Every Samsung is an example of an Android but not every android is an example of a Samsung. Androids are all phones or devices that are not made by Apple.

3 0
3 years ago
Other questions:
  • Thomas Hill claims that a fruitful way to think about the badness of destroying the environment is
    15·1 answer
  • What command would you run from a windows command line to test a computer's network stack?
    7·1 answer
  • What is the best java 3d modeler library?
    7·1 answer
  • What happens when variables in programming are not properly initialized? answers?
    13·1 answer
  • Exactly how thin is the air in outer space?
    10·1 answer
  • What is wrong with each of the following?
    6·1 answer
  • Which term refers to the blank areas surrounding a document page? *
    15·1 answer
  • To find the bottom 10 items of a list we need to click on Filter option
    12·1 answer
  • If you want to access your home network from your distant garage, a ________ might help boost the signal.
    15·1 answer
  • (e) The entries in each column of the array A are sorted into strictly increasing order.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!