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

 

pre4


Given a non-empty list of ints, return a new list containing the elements from the original list that come before the first 4 in the original list. The original list will contain at least one 4.


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

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

def pre4(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

Copyright Nick Parlante 2017 - privacy