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

 

konstans@stuy.edu all > sumAtoB
prev  |  next  |  chance

Find the sum of all ints from a to b, inclusive of both a and b. sumAtoB(1,3) is 1 + 2 + 3. When a > b, just return 0.


sumAtoB(0, 1) → 1
sumAtoB(1, 3) → 6
sumAtoB(2, 0) → 0

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

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