It looks like you are missing a right parentheses on your "b" variable.
#Current b variable
b = sum(row[0] for row in arcpy.da.SearchCursor(fc, 'QUANTITY_SOLID')),DefQ
#This returns both the b variable and the definition query separated by a comma similar to a tuple
#Should be to return a value of b from a search cursor with definition query DefQ
b = sum(row[0] for row in arcpy.da.SearchCursor(fc, 'QUANTITY_SOLID',DefQ))
The original script has the definition query outside the parameters of the SearchCursor tool. Then when the "b" variable is called later on, it is read as a tuple instead of a single string/integer/float/etc. By moving the definition query inside the parentheses, it should return a value "b" from search cursor with definition query "DefQ". This should return a single variable instead of a tuple.