It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming Python Forum

Using isinstance

Using isinstance

Postby sepulfan4eva on Sun Nov 08, 2009 7:27 am

Hi, new to this forum(and python) and would like some help plz.
Suppose I have the following input:

prediction=input("Enter score: ")

The user should enter the score in the format "x-y", for example, 2-0 or 3-1 etc..

My problem is how to create a validation here for numbers. It obviously fails using value error because of the "-". So I`m trying to use isinstance but always getting error (never used it before). So anybody can help please????

Thanks. :)
sepulfan4eva
 
Posts: 2
Joined: Sun Nov 08, 2009 7:17 am

Who is online

Users browsing this forum: No registered users and 0 guests