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

 

List-2 > sum67
prev  |  next  |  chance

Return the sum of the numbers in the array, except ignore sections of numbers starting with a 6 and extending to the next 7 (every 6 will be followed by at least one 7). Return 0 for no numbers.


sum67([1, 2, 2]) → 5
sum67([1, 2, 2, 6, 99, 99, 7]) → 5
sum67([1, 1, 6, 7, 2]) → 4

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

def sum67(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: 215.0

Copyright Nick Parlante 2017 - privacy