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

Find the slope of the line through each pair of points (20,18),(-9,-14)
Which was NOT a consequence of the Protestant reformation A:belief in purgatory B:wars of religion C:new Christian denomination D:the rise of nation-states
Using the subject “usted” and the verb in the imperative, tell your fitness instructor three things she or he must do. Then tell your fitness instructor two thi
The tail on Alex's dog is 51/4 inches long. This length is between which two inch-Marks on a ruler
what were some of the problems with ancient maps?
Write an equation of a parabola with its vertex at the origin and its focus at (0,-6)
What were the causes and effects of the civil war in russia?
the rise of fascism in germany between worl war 1 and world war 2 is often associated with?
x/x^2-16-7/x^2+5x+4  simplify
find the equation of the line through the given point and perpendicular to the given line (0,0);-2x+4y=12