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

 

david.white@denison.edu cs112fall2015 > sumTriplets
prev  |  next  |  chance

Compute the sum 3 + 6 + 9 + 12 + ... + n for any input n. (You can assume that n will always be a multiple of 3.)


sumTriplets(3) → 3
sumTriplets(6) → 9
sumTriplets(9) → 18

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

def sumTriplets(n):

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

Copyright Nick Parlante 2017 - privacy