# Example program using the isFloat() function
# isFloat takes a string as input, and returns a Boolean value
# as output.

# Add this line to the top of your program to make the couldBeFloat
# function available. You also need to have your program and the
# file "checkConversion.py" in the same folder when you run your program.

# Get access to the canBeFloat() function
from inputCheck import canBeFloat

# Ask user for input
inString = input("Enter a number: ")

# Check to see if the string can be converted to a float
# goodInput is a Boolean variable, that is, it is either True or False
# It is acting as a sentry variable, keeping track of what the state
# is.
goodInput = canBeFloat(inString)
# Print out the resulting Boolean value
print("The value of canBeFloat( '"+inString+"' ) is",goodInput)

if goodInput:
    print("The string '"+inString+"' could be converted to a float.")
else:
    print("The string '"+inString+"' could not be converted to a float.")

input("Press enter to exit")
