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
BigorU [14]
2 years ago
6

. Write a function sumLastPart which, only using list library functions (no list comprehension), returns the sum of the last n n

umbers in the list, where n is the first argument to the function. (Assume that there are always at least n numbers in the list. For this problem and the others, assume that no error checking is necessary unless otherwise specified. But feel free to incorporoate error checking into your definition.) sumLastPart :: Int -> [Int] -> Int
Computers and Technology
1 answer:
max2010maxim [7]2 years ago
7 0

Answer:

In Python:

def sumLastPart(n,thelist):

   sumlast = 0

   lent = len(thelist)

   lastN = lent - n

   for i in range(lastN,lent):

       sumlast+=thelist[i]

   return sumlast

Explanation:

This defines the function

def sumLastPart(n,thelist):

This initializes the sum to 0

   sumlast = 0

This calculates the length of the list

   lent = len(thelist)

This calculates the index of the last n digit

   lastN = lent - n

This iterates through the list and adds up the last N digits

<em>    for i in range(lastN,lent):</em>

<em>        sumlast+=thelist[i]</em>

This returns the calculated sum

   return sumlast

You might be interested in
A company operates on two types of servers: 2 large servers (L) and 4 smaller servers (S), with a combined total of 64GB RAM. Th
kati45 [8]

Explanation:

Let the size of a large server be L, and

the size of a small server be S.

We are given two scenarios,

2L+4S = 64.............(1)

and

L+3S = 40...............(2)

We solve the equations as follows

2(2)-(1)

2L-2L +6S-4S = 2*40-64

2S = 16

so S=8 ..................(3), size of small server

substitute (3) in (2)

L+3(8) =40

L = 40-24 = 16..............size of large server

8 0
3 years ago
Look at the picture lol
andrey2020 [161]

Answer:

Zoom in more please and than i can help

Explanation:

6 0
2 years ago
Read 2 more answers
In order to protect your computer from the newest virus, which of the following should you do after you've installed a virus sca
grigory [225]
After the viruses would be detected we have to clean them.
means we have to erase the virus . 
6 0
3 years ago
Name the box where the name of the first cell of the selected range appears?
sergey [27]

Answer:

Name box

Explanation:

From the picture, the name box is at the top left corner with B1 written inside, here B1 is written because it is the active cell at the time which also happens to be the first cell of the selected range. The name box can be used to easily create a named ranges rather Than having to draw the mouse over a group of cells. It also helps to know which cell is the current active cell as the cell address in the name box is the active cell at any point in time.

4 0
2 years ago
You work part-time at a computer repair store, and you are on-site at a customer's premises. Your customer has signed up for DSL
patriot [66]

The fill up are:

First Install the DSL router and link it to the phone line via:

  • Look at the Shelf, and expand Routers.
  • Take in the DSL router to the Workspace area.
  • Beyond the router, click on Back to switch to the back view of the router.

<h3>What is the steps about?</h3>

Next check On the Shelf, and expand Cables.

Click on the twisted pair cable that has RJ11 connectors.

Looking at the Selected Component window, take in a connector to the RJ11 port on the router.

Looking at the Selected Component window, take in or drad the other connector to the empty phone port that can be seen on the wall outlet.

Then Plug in the router via:

The Shelf, click on the power adapter.

  • Using the Selected Component window, take in the DC power connector to the power port on the DSL router and also take in the AC power plug to the wall outlet then:

Click on the computer to the DSL router as follows:

Beyond the computer, click on Back to switch to the back view of the computer and in the Shelf, click on the Cat5e cable.

Using the Selected Component window, take in a connector to the network port on the computer and then take in other connector to a network port on the DSL router.

The implementing DSL and Select the DSL filter then click on the phone cable under Partial connections and take in or drag unconncected connector to the RJ11 port on the filter.

Learn more about DSL internet  from

brainly.com/question/14599737

#SPJ1

5 0
1 year ago
Other questions:
  • What is the main idea of this article? Please someone help me. I will give brainliest answer
    7·1 answer
  • If she presses the left arrow , what will happened
    15·1 answer
  • Complete the paragraph to explain how Angelina can notify readers that her report is just a draft.
    6·1 answer
  • When is e-mail an appropriate channel for goodwill messages? If you frequently communicate with the receiver by e-mail and are c
    15·1 answer
  • What is the fastest way to locate a record for updating?
    6·1 answer
  • All of the following can be caused by the movement of geologic plates EXCEPT
    15·1 answer
  • Imagine you are responsible for making a presentation that includes a representation of the logic flow through a process. You un
    11·1 answer
  • Your dad just gave you his old computer running Windows 7. You want to see how many volumes are contained within it. Which tool
    10·1 answer
  • HELP ASAP Encoding a video format and then decoding it during playback is one of the functions of MPEG-4 and H.264 file players.
    10·2 answers
  • 12. In Justify the text is aligned both to the right and to the left margins, adding extra space between words as necessary *
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!