It depends on the type of
X. I am considering them of type string class.
if int(record.A or record.B) != 0 and int(record.C) == 1: record.X = str(int(record.A) / int(record.B)) # converting string to int while doing math operation and then converting the result to strting. else: record.X = record.A
CLICK HERE to find out more related problems solutions.