I wonder what does the code mean


#1



Replace this line with your code.

Hello!
I dont know "%.2f"s meaning in line 10.
I think f means float. however what does mean 2f?
% is for replacing total?
and why put dot(.) between % and 2f???


#2

%.2f is similar to %f, it is a placeholder,and then % total indicate you want total at the place of the placeholder

.2 which inside your %f, simply indicates you want 2 decimal numbers


#3

If I use ".3f", I could get 3 demical numbers! is it right?


#4

%.3f will indeed give you a 3 decimal number indeed


#5

I got it!
Thanks for giving me explanation!