This is a small collection of Python errors I've encountered while learning. I'm saving minimal examples and fixes as I go.
Each folder contains:
- reproduce.py
- fix.py
- README explanation
- TypeError: 'NoneType' object is not subscriptable
- TypeError: list indices must be integers or slices, not str
- TypeError: 'int' object is not callable
- TypeError: can only concatenate str (not "int") to str
- TypeError: string indices must be integers
- TypeError: object of type 'int' has no len()
- TypeError: unhashable type: 'list'
- TypeError: 'int' object is not subscriptable
- TypeError: greet() missing 1 required positional argument
- TypeError: unsupported operand type(s) for +: 'int' and 'list'
- IndexError: list index out of range
- IndexError: tuple index out of range
- IndexError: list assignment index out of range
- IndexError: string index out of range
- AttributeError: 'list' object has no attribute 'add'
- AttributeError: 'NoneType' object has no attribute 'append'
- AttributeError: 'NoneType' object has no attribute 'split'
- AttributeError: 'tuple' object has no attribute 'append'
- AttributeError: 'str' object has no attribute 'append'
- AttributeError: 'int' object has no attribute 'append'
- AttributeError: 'dict' object has no attribute 'append'
- ValueError: invalid literal for int()
- ValueError: too many values to unpack
- ValueError: not enough values to unpack
- ValueError: could not convert string to float
More error cases will be added as I encounter them while learning Python.
- Contact Log: Simple grouping logic that applies fixes for common TypeErrors and AttributeErrors.
- File Log Reader