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
Fudgin [204]
4 years ago
11

The scheme function (mult2-diff Ist) should take one argument, a list of numbers, and results in multiplying each number in the

list by two and then computing the difference of those numbers, e.g.: (mult2-diff'(912)) should evaluate to the difference of 18, 2 and 4: (18-2)-4, or 12. Finish mult2-diff below: (define (mult2-diff lst) (if
Computers and Technology
1 answer:
JulijaS [17]4 years ago
6 0

Answer:

The solution code is written in Python.

  1. def mult2_diff(lst):
  2.    num_list = []
  3.    for x in lst:
  4.        num_list.append(x * 2)
  5.    diff = num_list[0]
  6.    for i in range(1, len(num_list)):
  7.        diff = diff - num_list[i]
  8.    
  9.    print(diff)

Explanation:

Firstly, based on the requirement stated in the question, define a function <em>mult2_diff() </em>that takes one argument, <em>lst</em>, which is a list of numbers (Line 1).

This function is expected to multiply each number in the list by two and then followed with computing the difference. To do so, let's try to attempt the first function task, multiplying numbers.  Create a new list, num_list, to hold the multiplied numbers (Line 2). Use a for loop to traverse through each number in the input list, <em>lst</em>, and multiply each of them by two and add it to the <em>num_list </em>(Line 4-5).

To attempt the second function task, create another variable, <em>diff</em>, to hold the value of calculated difference between the numbers in the <em>num_list</em>. Initialize <em>diff </em>with the first number in the <em>num_list</em>. Use a another for-loop to traverse through each number in the num_list starting with second index, <em>1</em>, and calculate the difference between the <em>diff </em>and the current number extracted from the <em>num_list </em>through indexing.

At last print the output of <em>diff</em> (Line 11).

You might be interested in
Steve is conducting research on the reach of mental health care to the youth. After gathering data on psychologists, he creates
lora16 [44]

Answer:

Descriptive Statistics.

Explanation:

First Steve gathered the data and after that he created the pie chart displaying the percentage of psychologists working in different fields.Here Steve used descriptive statistics to display the data that he collected.

Descriptive statistics are the descriptive coefficients that give the abstract of the data collected.

6 0
3 years ago
What are three steps to use to research relevant information on the internet? (Site 1)
Mademuasel [1]

Answer:

Step 1: Questioning --- Before going on the Internet, students should structure their questions. Step 2: Planning --- Students should develop a search strategy with a list of sites to investigate. Step 3: Gathering --- Students use the Web to collect and gather information.

Explanation:

there i did it for you can I get brainlyest

5 0
4 years ago
Read 2 more answers
Where should the VPN concentrator be installed?
zmey [24]
C, using a firewall make sures no viruses enter your device while setting up the vpn
7 0
2 years ago
Read 2 more answers
You must lower your high beams when within how many feet of an approaching vehicle?
drek231 [11]

2000 feet of any vehicle

7 0
3 years ago
"abstraction" is often used to focus on a general case and ignore a specific instance of a problem. Given this meaning of the wo
prisoha [69]

Answer:

Abstraction is the process of removing or taking away certain characteristics to reduce or hide several very important characteristics.

In OOP (Object Oriented Programming), to increase efficiency and reduce complexity, a programmer hides certain vital data about an object. This is abstraction in programming.

For further clarification, a programmer ensures that the name given to an entity makes sense and most importantly, that it carries relevant aspects, and non essential parts are not included.

3 0
3 years ago
Other questions:
  • When you try to boot your computer it hangs after post?
    12·1 answer
  • I was not supposed to upgrade my iPad to iOS 11 due to testing but it automatically did when I was charging it. Is there a way t
    11·1 answer
  • How did people find the first ever piece of tech?
    6·1 answer
  • _____ is a component of a data model that defines the boundaries of a database, such as maximum and minimum values allowed for a
    12·1 answer
  • Whats the size of a short bond paper in microsoft word?
    10·1 answer
  • Which of the following software programs provides for e-mail communication?
    5·1 answer
  • Although implementations vary, reader–writer locks usually block additional readers if a lock is already held in read mode and a
    13·1 answer
  • WHO WANTS TO PLAY AMONG US
    15·2 answers
  • The final wrap-up after the conflict is resolved is called the __________________________.
    8·1 answer
  • What is the best AI app used in education?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!