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

what whole number grater than 1 is the smallest common factor of 45 and 75
Positrons are spontaneously emitted from the nuclei of (1) potassium-37 (3) nitrogen-16 (2) radium-226 (4) thorium-232
In what ways do political parties tend to unify, rather than divide, the American people?
which of the following is an accurate description of trends in the banking industry over the last thirty years? b. banks have become more decentralized c. banki
What is the advantage of not having a nucleus?
An investor bought 600 shares of stock, some at $5.00 per share and some at $4.75 per share. If the total cost was $2912.50, how many shares of each stock did t
A result of Theodore Roosevelt’s philosophy about conservation was A)the regulation of the drug industry. B)the creation of new railroads. C)the creation of nat
Supreme Court Justices are appointed for life (until they die or choose to retire). Discuss the pros and cons of this policy.
$22,102 is invested, part at 11% and the rest at 7%. If the interest earned from the amount invested at 11% exceeds the interest earned from the amount invested
which statement describes the stability of the nuclei of potassium atoms