Please am really confused about typeerror and value error.. please i need help | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Please am really confused about typeerror and value error.. please i need help

27th Jun 2019, 7:32 AM
Ogoh Augustine
Ogoh Augustine - avatar
2 Answers
+ 5
To see what causes this error we need your code.
27th Jun 2019, 10:26 AM
Lothar
Lothar - avatar
+ 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 😊
27th Jun 2019, 10:26 AM
aceisace
aceisace - avatar