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

in general, which of the following is NOT true concerning teens and marriage
I'll be home late, because I'm going to a concert tonight. Does the comma need to be there after the word "late"?
Why was the road to democracy more difficult for France than for England?
The maintenance of a stable internal environment is called.... A. homestasis B. regulation C. control D. balance
How did Great Britain combat Napoleon’s naval blockade?
62.5% as two equivalent forms
How did the law help to unify Muslim society?
Compare the religious beliefs of the Maya, the Aztecs, and the Inca. How were they similar? How were they different?
PLLLLEEEEEAAASEEE HELP ME!!!
Which Kingdom do you think was the most difficult to govern based on its geography?
good job