The following code isn't iterating as it should. I don't understand what the problem is. Please advise if you think you might be able to help me.
def getRainfallAmounts(namesOfMonths):
NUMBER_OF_MONTHS_IN_A_YEAR = 12
totalRainfallList = [ ]
for currentMonthIndex in range(NUMBER_OF_MONTHS_IN_A_YEAR):
monthlyRainfall = float(input("Please enter the rainfall amount for " +\
namesOfMonths[currentMonthIndex]))
totalRainfallList.append(monthlyRainfall)
return totalRainfallList