I am trying to validate a user input, and the user input is required to be positive integers including floating point numbers. I tried with isdigit(), it validated all the non-numeric inputs and negative integers as well but could not validate the floating point numbers. Below is my code
def is_number(s):
while (s.isdigit() == False):
s = input("Enter only numbers, not less than 0 : ")
return float(s)
#method call
while('true'):
membershipFee = is_number(input('Enter the base membership fee, or zero to quit: '))