Errors and solutions when using Python

Operating system: Ubuntu16.04

Error code (TypeError: object of type 'Quitter' has no len())

#-*-conding:utf-8-*-
while True:
    s = input('Enter something :')
    if s == 'quit':
        break
    print('length of the string is',len(s))
print('Done')

The first time you run it with Python, the version is wrong. If you run this code with Python 2, you will get an error, but not with Python 3.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324791300&siteId=291194637
Recommended