I am trying to adjust symbology using Python for a project with multiple fields that require if-else statements. The expression is below. No errors are being thrown, but there is no output. Please help if you can.
This is what I would like it to end up looking like:
MW-1
B: 20,000
T: 5,000
E: 9,0000
X:40,0000
Code:
def FindLabel ( [Name],[Benzene1],[Toluene1],[Ethylbenzene1],[Xylenes1] 😞
out = ""
out += "<UND>"+"<BOL>"+str([Name])+"</BOL>"+"</UND>"+"\n"
if float([Benzene1]) > 20000.0:
#bold
out += "<BOL>"+"B: "+ str([Benzene1]) +"</BOL>"+"\n"
else:
#normal
out += "B: "+ str([Benzene1]) +"\n"
return out
if float([Toluene1]) > 10000.0:
#bold
out += "<BOL>"+"T: "+ str([Toluene1]) +"</BOL>"+"\n"
else:
#normal
out += "T: "+ str([Toluene1]) +"\n"
return out
if float([Ethylbenzene1]) > 15000.0:
#bold
out += "<BOL>"+"E: "+ str([Ethylbenzene1]) +"</BOL>"+"\n"
else:
#normal
out += "E: "+ str([Ethylbenzene1]) +"\n"
return out
if float([Xylenes1]) > 12000.0:
#bold
out += "<BOL>"+"X: "+ str([Xylenes1]) +"</BOL>"+"\n"
else:
#normal
out += "X: "+ str([Xylenes1]) +"\n"
return out