Answer to Question #100608 in Python for Trevor

Question #100608
Write a program that accepts a number as input, and prints just the decimal portion. Your program must account for negative numbers.
1
Expert's answer
2019-12-19T14:38:36-0500

Decided this way

try:
	num = float(input("Insert the number: "))
	res = str(num)
	print("Fractional portion:", res[res.find('.')+1:])
except:
	print("ERROR! This is not a number!")

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