Ask Question
7 February, 11:34

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

+2
Answers (1)
  1. 7 February, 13:51
    0
    Def swapArrayEnds (array):

    tmp = array[ len (array) - 1 ]

    array[ len (array) - 1 ] = array[ 0 ]

    array[ 0 ] = tmp
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Write a function swaparrayends () that swaps the first and last elements of the function's array parameter. ex: sortarray ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers