nums=input("Enter four decimals/floats separated by a space:") n=nums.split(" ") sum_neg=0.0 for i in n: x=float(i) if(x<0): sum_neg+=x print("{:.2f}".format(sum_neg)
Need a fast expert's response?
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Comments