I've been working on this assignment for one of my class and I can't figure out how to round to 2 decimal even if it's .00
I'm printing a table and it just look's weird here's my result :
1 10000.0 600.0 10600.0
2 10600.0 636.0 11236.0
3 11236.0 674.16 11910.16
4 11910.16 714.61 12624.77
5 12624.77 757.49 13382.26
6 13382.26 802.94 14185.19
7 14185.19 851.11 15036.3
8 15036.3 902.18 15938.48
9 15938.48 956.31 16894.79
10 16894.79 1013.69 17908.48
I print a list of item that I round to 1 for [0] and to 2 for the rest (Sorry some of the var are in french XD)
for n in i_liste_l:
if n == i_liste_l[0]:
n = int(round(n,0))
i_liste_l[0] = n
else:
index_i = int(i_liste_l.index(n))
i_liste_l[index_i] = float(round(n,2))
i = i+1
print('{:>{width}}{:>{width}}{:>{width}}{:>{width}}'.format(*i_liste_l,width = indent))