Please I think there's something wrong with this logic. My code runs almost perfectly. I want the code to only accept inputs greater than 1 and reject inputs lesser than 1 and also reject "strings" but also prompt them to re-enter their inputs again. it works as I've indicated above, but each time I run input and pass a string for a test it rejects it, and prompts the user again, but if I input a correct input it now displays some error. any help would be appreciated.
def get_cents():
try:
cents = float(input("Change owed: "))
if cents > 0:
return cents
elif cents < 0:
print("invalid input, try again")
get_cents()
except ValueError:
print("invalid input, try again")
get_cents()