I am running some code in which I am expecting user to insert fraction which will be computed and stored as a float value in a variable.
I am using the following command. It works fine when I give input such as 4.5
:
a = float(input('>> '))
But something like 3/4
gives me an error. I know what the problem is, I would like to know if there is an alternative way to input a fraction which gets solved and stored as a float in a variable.