<html><head></head><body><div class="ydpc6b152f6yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;"><div><div dir="ltr" data-setdir="false"><div><div dir="ltr" data-setdir="false">I'm partly using a book to learn Python but mostly having a bash at it using the Pocket Reference by Mark Lutz. </div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">I'm trying to work out whether NumberOne is numeric and each time I run it I get a problem when the condition falls on False.</div><div><br></div><div>if ((NumberOne.isnumeric == False) and (NumberTwo.isnumeric == False)):</div><div> print("Retard - I asked for numbers")</div><div> print (NumberOne.isnumeric())</div><div> print (NumberTwo.isnumeric())</div></div><br></div><div dir="ltr" data-setdir="false">This is the True output....<br><div><div>0.3 x 0.8 = 0.24</div><div><br></div><div>Gimme Number 1 109</div><div><br></div><div>Gimme Number 2 123</div><div>and the aardvaark says 13407.0</div><div>end</div></div><br></div><div dir="ltr" data-setdir="false">When I enter non numerical numbers I get this output....</div><div dir="ltr" data-setdir="false"><div><div>Traceback (most recent call last):</div><div><br></div><div> File "<ipython-input-2-7bebae7324b7>", line 1, in <module></div><div> runfile('/home/rhys/Documents/Python/sexy.py', wdir='/home/rhys/Documents/Python')</div><div><br></div><div> File "/usr/lib/python3/dist-packages/spyder_kernels/customize/spydercustomize.py", line 827, in runfile</div><div> execfile(filename, namespace)</div><div><br></div><div> File "/usr/lib/python3/dist-packages/spyder_kernels/customize/spydercustomize.py", line 110, in execfile</div><div> exec(compile(f.read(), filename, 'exec'), namespace)</div><div><br></div><div> File "/home/rhys/Documents/Python/sexy.py", line 26, in <module></div><div> NumberOne = float(NumberOne)</div><div><br></div><div>ValueError: could not convert string to float: 'nonumber'</div></div><br></div><div dir="ltr" data-setdir="false">I'll probably have more equally clueless questions as I continue.</div><div><br></div><div class="ydpc6b152f6signature">Rhys Sage</div></div></div></body></html>