TypeError (टाइप एरर) :-
TypeError तब आती है जब किसी Operation (कार्य) या Function में गलत Data Type (डेटा प्रकार) का उपयोग किया जाता है। अर्थात, जब दो ऐसे Data Types पर Operation किया जाता है जो एक-दूसरे के साथ Compatible (संगत) नहीं होते।
English:
A TypeError occurs when an operation or function is performed on an incompatible data type. In other words, Python raises a TypeError when two data types cannot be used together in the given operation.
Wrong Example 1: Adding Integer and String
Output:
Correct Example -
Output:
Wrong Example 2: Adding Number and String
Output:
Correct Example -
Output:
Wrong Example 3: Wrong Number of Arguments
Output:
Correct Example
Output:
Wrong Example 4: Invalid Operation on Data Type
Output:
Correct Example
Output: