MCQ Single Best Answer Not Set

QWhat type of error will be shown after the following statement?
a = 'Python' + 3

ID: #3796 Python Errors and Exceptions Handling 313 views
Question Info
#3796Q ID
Not SetDifficulty
Python Errors and Exceptions HandlingTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A SyntaxError
  • B TypeError
  • C ValueError
  • D NameError
Correct Answer: Option B

Explanation

TypeError
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Input In [4], in ()
----> 1 a = 'Python' + 3

TypeError: can only concatenate str (not "int") to str

Share This Question

Challenge a friend or share with your study group.