mardi 22 septembre 2020

for loop with two list and if statment [closed]

I have two lists ib = ['-0.20' , '0.20' , '1.30' , '1.50' , '-1.24' , '0.12' , '-19.20'] company = ['Consol XYZ' , 'Consol XYZ' , 'Consol XYZ' , 'Consol XYZ' , 'Consol XYZ' , 'Equity Corp.' , 'Equity Corp.']

i need to create a new list tlcf_est with these conditions

  • For Consol XYZ, when ib is negative, tlcf_est is the absolute value of ib
  • For Equity Corp., when ib is positive, tlcf_est is 0
  • For Equity Corp., when ib is negative, tlcf_est is 50% of the absolute value of ib
  • For Consol XZY, when ib is positive, tlcf_est is 0

can someone help please ?

Aucun commentaire:

Enregistrer un commentaire