0

Please help me for creating python program to find the best company in a sector based on ROCE, income growth, sales growth.

You have to write a basic python program to find the best company in a sector based on ROCE, income growth, sales growth and Debt/Equity ratio.

3rd Feb 2022, 2:37 AM
Tushar Jain
Tushar Jain - avatar
2 Answers
0
how the data is supposed to be provided ?
3rd Feb 2022, 6:45 PM
Robert BƂaszczyk
Robert BƂaszczyk - avatar
0
i know if terrible, but it does the basic thing c_data= ("CHACHA", "35%","12%","50", "1.4") b_data= ("RUMBA", "45%","20%","23", "1.0") d_data= ("SALSA", "10%","10%","60", "0.8") a_data= ("BACHATA", "60%","12%","34", "1.2") base = (c_data, b_data,d_data,a_data) max_roce=0 max_igrowth=0 max_sgrowth=0 max_deratio=0 for i in base: r=float(i[1].strip('%')) ig=float(i[2].strip('%')) s=float(i[3].strip('%')) de=float(i[4].strip('%')) if max_roce ==0 or r > max_roce: max_roce=r best_roce= i if max_igrowth ==0 or ig > max_igrowth: max_igrowth=ig best_igrowth= i if max_sgrowth ==0 or s > max_sgrowth: max_sgrowth=s best_sgrowth= i if max_deratio ==0 or de > max_deratio: max_deratio=de best_deratio= i print("The company with the best ROCE is: ", best_roce[0]) print("The company with the biggest income growth is: ", best_igrowth[0]) print("The company with the biggest sales growth is: ", best_sgrowth[0]) print("The company with the biggest D/E ratio is: ", best_deratio[0])
3rd Feb 2022, 8:26 PM
Robert BƂaszczyk
Robert BƂaszczyk - avatar