<nicholascann...@gmail.com> wrote: > I am making a calculator and i need it to support floating point values > but i am using the function isnumeric to check if the user has entered an > int value. I need the same for floating point types so i could implement > an or in the if statement that checks the values the user has entered and > allow it to check and use floating points. If you need the source code i > am happy to give it to you. Thank you for your help
It's better to ask forgiveness than ask permission... You don't have to check anything. If the user enters something that cannot be coverted to a float, the function float() will raise an exception: try: x = float(value) except ValueError: # not a float pass Sturla -- https://mail.python.org/mailman/listinfo/python-list