A bit late, but maybe this will help others. The original code needed first to have != changed to == (as mentioned above). But once you do that, you're right, you could combine all of the statements that wanted to set the value to 4 by using a list and then checking for membership in the list. For example, you could do something like this:
four_type_soils = ["Till", "Paleasol", "Clay"]
if fld == "Soil or Fill":
a = 1
elif fld == "Alluvium":
a = 2
elif fld == "Loess":
a = 3
elif fld in four_type_soils:
a = 4
else:
a = 9