-1

I am trying to create a grade calculator that performs an operation based on what is inputted before and after the operator instead of asking for two separate inputs. For example:

input = input("Grade: ")

input would be something like "19/25" and the program would divide 19/25

Mustafa
  • 15
  • 4
  • Check this answer: https://stackoverflow.com/questions/2371436/evaluating-a-mathematical-expression-in-a-string – Avinash May 21 '22 at 17:34

1 Answers1

0
inp = input("Insert operation: ")
print(f"Result: {eval(inp)}")
John Giorgio
  • 634
  • 3
  • 10