What is the output of the following code ?
x = "python" def foo(k): print(k) + x foo("cpython")
It will print "cpython" first for the statement print(k)Here in print(k) + x, we are trying to add the return value of print(k) to "x".but print() returns None and type of "x" is string.So it will print error as
print(k)
print(k) + x
HI Sir,
I have executed the same lines of code on my python 2.7 , it resulted cpythonpython, but "correct answer as per website is - typeerror
please check