You need to print the details when you find a valid format, and also break out of the loop. If the loop completes without finding one, the you can print the exception message. So your code should be:
for i in date_formats:
try:
d = datetime.strptime(x, i)
print(F"{x = }, {i = }")
break
except ValueError:
pass
else:
print("False")