Answer to Question #263377 in Python for angel

Question #263377

5. Decimal Galore


We've been dealing with integers too much, it's time for decimals to shine!


Instructions:

  1. Input five decimal numbers in one line.
  2. Print out the decimal numbers in one line, separated by spaces, and make sure you only print up to 1 decimal place.
  3. Add the first four decimal numbers and check if their sum is greater than the fifth decimal number. Print out "Yes" if they are.

Input

A line containing five decimal numbers separated by a space.

1.1·1.2·1.3·1.4·1.1

Output

The first line contains all the inputted decimal numbers separated by a space.

The second line contains a string which is the result.

1.1·1.2·1.3·1.4·1.1
Yes
1
Expert's answer
2021-11-09T12:16:49-0500
arr = map(float, input().split())
if len(arr) != 5 or arr[0]+arr[1]+arr[2]+arr[3]<=arr[4]:
  print('No')
else:
  print(*arr)
  print('Yes')

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