In a while
loop, the following code tries to convert the input string to int
.
isbn = int(input('Please enter the 10 digit number: '))
int
objects has no isdigit
methods; cause AttributeError
.
>>> isbn = 12345
>>> isbn.isdigit()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'int' object has no attribute 'isdigit'
len(int)
causes TypeError
.
>>> len(isbn)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: object of type 'int' has no len()
Remove int(..)
call.
isbn = input('Please enter the 10 digit number: ')