Just a try:
x = float(input('enter number: '))
while x % 1 == 0:
print ("the number entered must be a decimal number")
x = float(input("Enter a decimal number:"))
[/CODE] Read More
Actually I'd like to recommend using a library for input validation (like pycerberus). You get a lot of infrastructure from these library (better code structure, i18n support and good error messages for example) even if you have to build specific validators yourself. IMHO too many people implement half-baked validation rules (and forget to check for all the corner cases!) instead of doing it only once but 100% right... This is also the cause of many security problems...