Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

readme.md

TypeError: object of type 'int' has no len()

Reproduce

value = 100

length = len(value)

Error Message

TypeError: object of type 'int' has no len()

Fix

value = 100

length = len(str(value))

Reflection

I tried to use len() on an integer.

Reference

Related case: https://pyai.io/en/python/basic/builtin-functions/