id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

cse160-staff@cs.washington.edu cse160_20wi_checkin03 > make_ends
prev  |  next  |  chance

Given an array of ints, return a new array length 2 containing the first and last elements from the original array. The original array will be length 1 or more.


make_ends([1, 2, 3]) → [1, 3]
make_ends([1, 2, 3, 4]) → [1, 4]
make_ends([7, 4, 6, 2]) → [7, 2]

...Save, Compile, Run (ctrl-enter)

def make_ends(nums):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Difficulty: 133.0

Copyright Nick Parlante 2017 - privacy