79783841

Date: 2025-10-06 15:29:45
Score: 0.5
Natty:
Report link
while True:
    fraction = input("Fraction: ")

    try:

        x, y = fraction.split("/")
        x, y = int(x), int(y)
        if y == 0 or x < 0 or y < 0:       #here is where you in put you negative fraction factor
            raise ValueError("Invalid input")

        percent = x/y
        if percent<= 1:
            break
    except (ZeroDivisionError, ValueError):
        pass

percent = percent * 100
percent = round(percent)

if percent <=1:
    print("E")

elif percent >= 99:
    print("F")

else:
    print(f"{percent}%")
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: Belinda