def main():
M = float(input('Please enter sales for Monday: '))
T = float(input('Please enter sales for Tuesday: '))
W = float(input('Please enter sales for Wednesday: '))
R = float(input('Please enter sales for Thursday: '))
F = float(input('Please enter sales for Friday: '))
sales = [M, T, W, R, F]
total = 0
for value in sales:
total += value
print ('The total sales for the week are: $',total('.2f'))
main()
With the .2f
format I am getting this exception:
TypeError: 'float' object is not callable
If I remove the .2f
the script runs properly but the formatting is not how I would like it, it displays as:
The total sales for the week are: $ 2500.0
I would prefer to have it so that there are 2 decimal places and no space between the $ sign.
Still new to python and learning the basics. Your help is greatly appreciated.