I have the following code:
from fractions import Fraction
p= input("Input the chance of occurrence")
while True:
try:
p=float(p)
break
except ValueError:
try:
p=float(sum(Fraction(s) for s in p.split()))
break
except:
print("I don't understand the given input")
continue
The thing is that when the third case is given, it doesn't ask for another input, instead continues printing "I don't understand the given input", so, how can I prevent this Thanks in advance