I'm trying to use a for loop in a list to assign different buffer widths to the list depending on the length of the line being buffered. I have my list of lengths, and tried to use a for loop to iterate the list with an output variable to hold the new buffer width values. When I say print buffer_width, the result is "300 Feet" so the for loop is not going though every item in the list, just printing the last item. Finally, I'd like to place my buffer_width variable into the buffer_analysis() function.
length = [1990, 2016, 3051, 3279, 1855, 3432, 4323, 3016, 4218] for le in length: if le < 3000: buffer_width = "75 Feet" elif le > 4000: buffer_width = "300 Feet" else: buffer_width = "175 Feet" print buffer_width