Answer to Question #261426 in C for jzcruz

Question #261426

The first three lines will contain message prompts to input the three decimal numbers.

The last line contains the result in two decimal places.


1
Expert's answer
2021-11-05T07:25:15-0400
list1 ​= []
for ​i in range(4): ​n = eval(input('Enter no here: ')) ​if n > 0: ​list1.append(n)
print('Sum of all positive integers = {}'.format(round(sum(list1), 2)))


Enter no here: 12.1

Enter no here: -321

Enter no here: -34

Enter no here: 53.3

Sum ​of all positive integers = 6


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS