0
Difficulty with raise block output in py
I tryed one code for raise block of python where i supposed to get output as >TypeError But it will showing >It's own error type then Type error Anyome explain why
3 Antworten
+ 2
Rushikesh Dakhore That link worked, I think the issue was that everything was converted to lowercase in the tag, and the code URLs are case sensitive. Next time I'd suggest putting it in the question body rather than in the tags.
+ 2
The link to your code in the tag did not work, but I found the code that (I think) you were trying to reference. From that code, the first TypeError is because you were trying to add 5 (an integer) and 'rushi' (a string). These types are not compatible for addition in python, so a TypeError is thrown.
Once this error is fixed, your "raise TypeError" line will be reached and executed, returning the error you expected. Note that the error message will point to the line with the raise statement, but this is just how raise works, there is not an error in your raise statement.
0
Thank you for your answer JS Coder
i am writing post for the first time may be that's why it don't khow how to attach code
https://code.sololearn.com/cStY21ZpN2nd/?ref=app