Dear list,
i have problem, i was going through with python programming and found there is something missing in case of float data types.
what i am trying to do is:
i am writing a simple program in which i asked user to input salary, i want to ristrict user to input anything irrelevant, for that i can use "try and exception", but how it will be done without using "try and exception",
like there something lke "isdigit, isalpha", by using this user cannot enter anything other than interger or alphanumeric, but in case of flot i have no clue.
here i am posting my code which i used for integer by using isdigit :
import sys
weight = raw_input("enter the weight: ")
while not (weight.isdigit()): # check of weight is a digit, if not get valid entry
weight = raw_input ("enter the weight of boy in integer: ")
print weight
waiting for your reply.