Write a function getSumOfLastDigits() that takes in a list of positive numbers and returns the sum of all the last digits in the list.
写一个函数getSumOfLastDigits() 使输入列表的元素的最后一个位相加,求的和
def getSumOfLastDigits(numList):
length = len(numList)
list1 = []
for i in range(length): #要用range()进行遍历,不是只写一个length,新手容易在这上面犯错
x = int(str(numList[i])[-1])
list1.append(x)
print (sum(list1))