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
What’s the purpose of balancing or monitoring your checking account?
emmasim [6.3K]
B) To help you calculate how much money you have in your account.
3 0
3 years ago
Read 2 more answers
An isp is a group of updates, patches, and fixes that apply to specific oss.
olasank [31]
<span>The statement that an ISP is a group of updates, patches, and fixes that apply to specific OSs is false.
</span> ISP stands for Internet service provider, while OSS stands for Operations support system.<span> The term ISP denotes a company or</span><span> organization that provides services for accessing, using, or participating in the Internet. OSS on the other hand is used by the providers to manage their networks.
</span>
4 0
3 years ago
Please explain what Level 5 Automation is and give 2 examples of the technology.
arsen [322]

Level 5 ( Full Driving Automation ) Level 5 cars won't even have steering wheels or acceleration / braking pedals . They will be free from geofencing , able to go anywhere and do anything that an experienced human driver can do .

Pls follow me and Mark as brainlest!!! :-)

8 0
3 years ago
Survey data can be collected with questionnaires. Which type of question has a limited number of preselected responses?
nadya68 [22]
The answer to your problem is B
8 0
3 years ago
A developer needs to create a visualforce page that displays case data. The page will be used by both support reps and support m
shutvik [7]

Answer:

B. Use a new support manager permission sets

Explanation:

According to the requirements, field level security is required so, 1st options is not suitable because it may reduce the maintenance cost but increase the risk of security.

By creating a separate page for each of the two, it will leads to increase in the maintenance cost of the system. So <u>Option C</u> is also not suitable.

Option B is more Suitable as compared to others, that <em>Create a new support manager permission set</em>, with the help of this, both of Support rep and Support manager can visualize their required information with the help of support manager permission. This solution will not compromise the security and not increase the maintenance cost.

7 0
3 years ago
Other questions:
  • LOOK TO THE LEFT AND RIGHT BEFORE ENTERING ANY INTERSECTION ON A GREEN LIGHT BECAUSE:
    12·2 answers
  • What are the first two lines of defense a company should take when addressing security risks?
    10·1 answer
  • The countryside presents
    11·1 answer
  • A program is considered portable if it . . . can be rewritten in a different programming language without losing its meaning. ca
    13·1 answer
  • Given the declarations struct BrandInfo { string company; string model; }; struct DiskType { BrandInfo brand; float capacity; };
    11·1 answer
  • What should you do to help prepare yourself for the delivery of your presentation? you can chose more then one
    8·1 answer
  • Draw a flowchart to find the average grade in 3 subjects
    7·1 answer
  • Something I should look for when trying to decide if a source is credible is the publication's ....
    10·1 answer
  • window operating system popularly known as. 1) character user interface. 2) computer user interface. 3) graphic user interface.
    15·1 answer
  • Kenny is asked to submit a photo for the annual photographic competition. He decided to capture a photo with the light-painting
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!