Try changing: numlist = number.split(".") to: numlist = map(int, number.split(".")) Your problem is that your list is of strings. Cheers, Brian