हिंदी

When do we get a TypeError?

Advertisements
Advertisements

प्रश्न

When do we get a TypeError?

लघु उत्तरीय
Advertisements

उत्तर

A TypeError occurs when an operation or function is applied to an object of an inappropriate type.

Examples:

"2" + 3          # TypeError
len(10)           # TypeError
3 + [1, 2]        # TypeError

It can also occur when a function receives the wrong type or number of arguments.

shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 8: Exception Handling & Generate Functions - EXERCISE [पृष्ठ १५८]

APPEARS IN

सीबीएसई Computer Science with Python [English] Class 12
अध्याय 8 Exception Handling & Generate Functions
EXERCISE | Q 6. | पृष्ठ १५८
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×