On 04/08/2013 06:37 AM, Woody 544 wrote:
Max,

You've made the arguments a string (so never a number) in:

print "The answer is: " + str(x+y)

MJ

That has nothing to do with the issue. The str() function call is unnecessary, but harmless. If the two values x and y are ints or floats, they will get added in the obvious way long before being converted to str().

If they are already strings, they'll be concatenated long before str() does a null conversion on the resultant string.

The problem, as I stated in my own response, is that the if statement does nothing useful for checking of types.


--
DaveA
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to