+ 2
Please am really confused about typeerror and value error.. please i need help
2 Antworten
+ 5
To see what causes this error we need your code.
+ 4
âą TypeError is thrown when an operation or function is applied to an object of an inappropriate type.
âą Example:
âââââââââââ-
â2â+2
>>> TypeError: must be str, not int
ââââââââââââ
âą Explanation:
You are trying to add a string (text) to an integer, which is not allowed
âą ValueError is thrown when a function's argument is of an inappropriate type.
âą Example:
ââââââââââââ
int('abc')
>>> ValueError: invalid literal for int() with base 10: 'abc'
ââââââââââââ
âą Explanation:
Youâre trying to convert a string to an integer. âabcâ are letters, not integers, so this error is raised.
Information taken from
https://www.tutorialsteacher.com/JUMP_LINK__&&__python__&&__JUMP_LINK/error-types-in-python
All credit goes to them.
Hope this helps đ