Q:

Bad IF Statement in my python

I have this piece of code, and everything works fine, and now I am trying to build the IF statement correctly. 
I only have one ASCEND function right now, so yea, the IF statement references it for ascend and descend, so ignore that piece. When I typed in "r" as my 'answer', it still ran the rainSortAscend. 
Can you help point me in the right direction for the IF statement?
answer = ""
print('Do you want the rainfall to be ascending or descending?')
answer = input('Answer with "A" or "D"' + answer)

def rainSortAscend(monthRainfall):
    for number in range(len(monthRainfall)-1,0,-1):
        for i in range(number):
            if monthRainfall[i]>monthRainfall[i+1]:
                temp = monthRainfall[i]
                monthRainfall[i] = monthRainfall[i+1]
                monthRainfall[i+1] = temp

if answer == 'a' or 'A':
    rainSortAscend(monthRainfall)
    print(monthRainfall)
elif answer == 'd' or 'D':
    ranSortAscend(monthRainfall)
else:
    print('Start over and type in the specified "A" or "D" option')

A:

Since you are using if answer=='a' or 'A', the 'A' will always be true which causes rainSortAscend function to run everytime. if you want to validate single variable for multiple values. You can write your code as shown below
if answer in('a','A'):
    rainSortAscend(monthRainfall)
    print(monthRainfall)
elif answer in('d','D'):
    ranSortAscend(monthRainfall)
else:
    print('Start over and type in the specified "A" or "D" option')

