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

 

sum2digits


Given an integer n with 2 digits or less, return the sum of its digits.


sum2digits(47) → 11
sum2digits(90) → 9
sum2digits(1) → 1

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

def sum2digits(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: 290 Post-solution available

Copyright Nick Parlante 2017 - privacy