I tried using a simple function after asking for a decimal d
but realized that the exception is that it didn't catch the difference between 8, and 8.0, and don't really know how to fix it. I tried saving them into strings and comparing them but that didn't work either.
def validdec():
if d == round(d):
print("Invalid decimal.")
else:
print("Valid Decimal.")