2 RĂ©ponses
0
how the data is supposed to be provided ?
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])