Necessary in commerce
1 2 3 4 5 6 7 8 9 10 | import re
print " Write product name : "
nume_produs = raw_input()
print " Write product price : "
cost_produs = input()
if (nume_produs == re.sub('[^a-z]',"",nume_produs)):
print ('%s %d'%(nume_produs,cost_produs))
else:
print "Error ! You must tape letters"
input()
|
I tried this, and it told me that "XBox 360" failed to validate. So did "Windows 7", "Levi's 501", "WD-40", and "V8 vegetable juice", all product names I either own or see in the shops. Perhaps your validation rule is too strict?