Blank guess


#1

Traceback (most recent call last):
File "python", line 30, in
ValueError: invalid literal for int() with base 10: ''


#2

If your statement is,

`user_input = int(raw_input("Enter a number: "))

and the user presses Enter, a None will be returned, which cannot be made into an integer.

That's one scenario. If a non-number is inputed it too will raise an error. But at this point we are not dealing with exceptions or incorrect inputs. It is assumed that as the one who is writing the code one will have wherewithal of what inputs are expected. No mystery there.

This is a non-issue, as the lesson goes.


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.