I have this while loop that is testing to make sure the user inputs either 1, 2, or 3. Once the user inputs 1, 2, or 3, the loop keeps going infinitely, i can't get out of it.
while True:
try:
filterselection = raw_input("Please select a filter (1, 2, or 3): ")
if filterselection == "1" or filterselection == "2" or filterselection == "3":
filterselection = int(filterselection)
break
else:
print "Not a valid number try again!"
except TypeError:
print "Lol, that's not a number try again!"

ors you can use theinoperator and sayif filterselection in ('1', '2', '3'):. for your health.TypeErrorcould occur. Unless you wanted to change theifto sayif int(filter_selection) in range(1,4):