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

The ratio of Isabella's money to Shane's money is 3:11. If Isabella has $33, how much money do Shane and Isabella have together?
Is the first 4 in 4043 ten times as great as the second 4? Why or why not?
What goes into 16 three times
What is the place value of 7 in 0.782
A bird travels 1.70 x 10^4 km south then turns around and travels 6.00 x 10^2 north. He then turns around again immediately and flies 1.44 x 10^4 km south. What
the probability that your ticket will be chosen in a drawing is 6% there are 250 tickets in the drawing how many tickets are yours
What goes into 16 three times
The battle for political legitimacy in Somalia is between __________. a. Afrikaners and the African National Congress b. Jews and Arab Muslims c. the Hutu ma
Their fur helps them defend themselves what is the verbs and is it past present or future
Use refuge in a sentence