How to convert a string containing "/" to a float in Python : <p>I have some dimensions typed as a text in inches format, example:
text = "20 7/8 16 1/4" # the first two represent, let's say, the length, and the second two represent the width
I can change this string into a list of strings using text.split() to get: ["20", "7/8", "16", "1/4"].</p>

<p>Now, I want to add the first two items 20 + 7/8 to get 20.875. How can I convert 7/8 to a float number?</p>
