Answer to Question #267195 in Python for isaiah

Question #267195

Write a program to convert a fraction to a decimal. Have your program ask for the numerator first, then denominator. Make sure to check if the denominator is zero.


1
Expert's answer
2021-11-16T13:50:42-0500
def check(n,d):
    if d==0:
        return "denominator is zero"
    else:
        return n/d
n = int(input())
d = int(input())


print(check(n,d))

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