codybrocs7001 codybrocs7001
  • 06-12-2017
  • Computers and Technology
contestada

Write a function swaparrayends() that swaps the first and last elements of the function's array parameter. ex: sortarray

Respuesta :

rsmith6559
rsmith6559 rsmith6559
  • 07-12-2017
def swapArrayEnds( array ):
    tmp = array[ len( array ) - 1 ]
    array[ len( array ) - 1 ] = array[ 0 ]
    array[ 0 ] = tmp


Answer Link

Otras preguntas

I helpe my neighbor yesterday
Rewrite the function f(x)=-4(x-4)^2+26 in the form f(x)=ax^2+bx+c
12. Ivy had 25 more bracelets than Audrey. After Ivy bought some bracelets, the number of bracelets she had increased by 36%. After Audrey gave away some of her
Make a box plot for the given data : 17,29 ,32,30,14,9,39,10,32,23
Which of the following lines of poetry uses repetition (repeated words)? A. Since earth is earth perhaps, not heaven (as yet) - B. It only gives our wish for bl
Can you pls help me with this
It is okay to speed 7-10 mph over the posted speed limit. The police cannot write speeding tickets for that.
HELP ASAP!!!!!!!! LIMITED TIME!!!!! The graph shows the concentration of carbon dioxide (Co2) in the atmosphere from 1957 to 1996. Carbon dioxide is associated
35 PTS. Don’t explain. y=?
Identify two segments that are marked congruent to each other on the diagram below. (Diagram is not to scale.)