Solution for Python QnA for November 14, 2018.
In this (x+y); addition of integer and string is not allowed. hence we get the TypeError.
# OUTPUT****************************************** >>> x = input() 12 >>> y = int(input('Please enter a number')) Please enter a number45 >>> x+y Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: must be str, not int >>> y+y 90 >>> x+x '1212'
In this (x+y); addition of integer and string is not allowed. hence we get the TypeError.
Comments
Post a Comment