CJCoding With Joseph
15free / daySign inCreate account

Swap The Ends

Exchange the first and last elements of the list grades using three assignments and a temporary variable named temp, so neither value is lost, then print the list; the output shows 79 at the front and 74 at the back with the middle untouched. No input is read.

Expected Output:

[79, 88, 91, 65, 74]

= newline. The output ends with a newline — print one after the last line.

Hints3 available
Topics:
ListsVariables
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.