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

 

middle


Write a function called middle that takes a list and returns a new list that contains all but the first and last elements. For example: >>> t = [1, 2, 3, 4] >>> middle(t) [2, 3]


middle([1, 2, 3, 4]) → [2, 3]
middle([1, 2]) → []
middle([1]) → []

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

def middle(t):

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: 103 Post-solution available

Copyright Nick Parlante 2017 - privacy