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

 

konstans@stuy.edu > sumRange
prev  |  next  |  chance

Compute the sum of the integers between a and b inclusive. This range of values can be specified in any order, so a does NOT have to be less than b. sumRange(2,0) -> 2 + 1 + 0 -> 3


sumRange(1, 2) → 3
sumRange(2, 1) → 3
sumRange(-3, -10) → -52

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

def sumRange(a,b):

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