[Tutor] (no subject)
Austin Rodgers
aj.rodgers at live.com
Tue May 3 00:26:14 CEST 2011
I’m trying to learn by using pyschools.com, and ran across a question I can’t answer. I tried to google it, but I don’t even know what type of function I’m looking for. I know I am supposed to modify the list, but I just can’t figure out how. anyway, here’s the question:
Write a function getSumofLastDigits() that takes in a list of positive numbers and returns the sum of all the last digits in the list.
Examples
>>> getSumofLastDigits([2, 3, 4])
9
>>> getSumofLastDigits([1, 23, 456])
10
how would I go about writing this function?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110502/49ee0667/attachment.html>
More information about the Tutor
mailing list