import getpass


def validInput(prompt):
	"""
	Get a valid input and convert it to a float number.
	"""
	while 1:
		inputStr = getpass.getpass(prompt)
		try:
			inputFloat = float(inputStr)
			return inputFloat
		except ValueError:
			print("Invalid input. Try again.")
			pass