The code does accept numbers but when entered wrong twice it comes up with an error
isbn= input('Please enter the 10 digit number: ')
while not(len(isbn) == 10 and isbn.isdigit()):
print('Please make sure you have entered a number which is exactly 10 characters long.')
isbn=int(input('Please enter the 10 digit number: '))
continue
else:
total= 0
for i in range(len(isbn)):
total= int(isbn[i])
calculation=total%11
digit11=11-calculation
if digit11==10:
digit11='X'
iSBNNumber=str(isbn)+str(digit11)
print('Your 11 digit ISBN Number is ' + iSBNNumber)
else:after thewhileis not needed. You could take all that code and put indent it one block to the left. Also, I don't think you're doing the right thing withtotal = int(isbn[i])...