使用正则表达式。
import rep = re.compile('d+(.d+)?')a = raw_input('How much is 1 share in that company? ')while p.match(a) == None: print "You need to write a number!n" a = raw_input('How much is 1 share in that company? ')
使用正则表达式。
import rep = re.compile('d+(.d+)?')a = raw_input('How much is 1 share in that company? ')while p.match(a) == None: print "You need to write a number!n" a = raw_input('How much is 1 share in that company? ')