I am working on python, what is wrong with the following code:
try: x, y = input("fraction: ").split("/") result= int(f"{x}* 100/{y}%") if result <= 1: print("E") elif result >= 99: print("F") else: print(result) except (ValueError, ZeroDivisionError): print(x, y)
I expected the code to calculate the result and output the %, but it only give me the same input as output
New contributor
user25001486 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.