I am not sure if you would classify this as a documentation bug or minor software bug I have been teaching an Introduction to Programming using Python at Lehman College for more than half a dozen years. For the first problem covering "if", I ask the students to write a program where the user is prompted to enter an integer and the program logic determines whether the number is odd or even. I was surprised to see a student submission contain: if number % 2 == int() : #even rather than if number % 2 == 0: #even The Documentation did not say what happens if there was no argument. I though an Exception would be thrown, but "no", int( ) returned a 0 Also float() returns 0.0 Jeff Gitlin Lehman College Bronx, New York
participants (2)
-
Arthur Milchior
-
Jeffrey Gitlin