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

 

first_last


Given a 4-digit integer n, return the sum of the first and last digits.


first_last(1234) → 5
first_last(9001) → 10
first_last(9876) → 15

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

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

Copyright Nick Parlante 2017 - privacy