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]
3 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]3 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
Free wifi is typically offered on an <br> a) unencrypted<br> b) encrypted<br> c) open<br> d) private
aliya0001 [1]

c) open

I think this because when you're in an open space (such as starbucks) it's public for anyone to enter. I think.

7 0
3 years ago
Read 2 more answers
Why green office became popular among businesses? ​
Tanzania [10]

Answer:

Going green has several other benefits for companies. These include tax credits and incentives, improved efficiency, healthier workplaces, and cost savings – for instance by printing less, turning lights off in unused rooms and refilling ink cartridges. Reusing items also reduces waste from plastic packaging.

Explanation:

3 0
3 years ago
Read 2 more answers
Just take points, this website is so weird because of all the reporting and I didn't do any thing
krok68 [10]

Answer:

I agree with you! And thank you for the points

Explanation:

I answer educational questions and ask one of my own regarding math and it gets reported

Someone asked if their art was good and how they can improve it and it gets reported

But the only questions they don’t report are free po!nts

For the people who don’t have anything better to do then report people trying to get help: STOP ITS ANNOYING NOT JUST FOR ME BUT THE PEOPLE WHO ARE TRYING TO GET HELP, INSTEAD OF REPORTING WHY DONT U HELP PEOPLE???

7 0
2 years ago
Read 2 more answers
Explain the procedure you will undertake to create a new partition​
MA_775_DIABLO [31]

To create a partition from unpartitioned space follow these steps:

Right click This PC and select Manage.

Open Disk Management.

Select the disk from which you want to make a partition.

Right click the Un-partitioned space in the bottom pane and select New Simple Volume.

Enter the size and click next and you are done.

8 0
3 years ago
INTRODUCTION TO JAVA​
amid [387]

Answer:

INTRODUCTION TO JAVA​

Explanation:

Java is one of the most popular programming languages out there. Released in 1995 and still widely used today, Java has many applications, including software development, mobile applications, and large systems development. Knowing Java opens a lot of possibilities for you as a developer.

5 0
3 years ago
Other questions:
  • Why was Unicode invented?
    6·1 answer
  • A ________ pays out cash flows from a collection of assets in different tranches, with the highest-rated tranch paying out first
    8·1 answer
  • If you are driving at night, you should not use high-beam headlights within _________ of oncoming vehicles. Florida Road Rules 4
    9·2 answers
  • Research at least two articles on the topic of managerial issues of a networked organization. Write a brief synthesis and summar
    8·1 answer
  • Una bombilla de 40 w de potencia está encendida durante 10 horas. Calcular la energía que ha consumido en julios y en kw·h.
    12·1 answer
  • To read visual and audio text means
    11·1 answer
  • Why might a business choose a server-based network over a peer-to-peer network?
    15·1 answer
  • Translate We get up at 8 o'clock into Spanish in the box below:​
    9·1 answer
  • Discuss the advantages of using analogue multi-tester or digital multi-tester over the other.​
    12·1 answer
  • Mavis is considering signing up for a hosted enterprise software solution for her small business. She recognizes that an advanta
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!