Computer Science
What will be the output produced by following code ?
>>> print(print("Hola"))
Python
Python Funda
8 Likes
Answer
Output
Hola None
Explanation
First, print("Hola") function is executed which prints the first line of the output as Hola. The return value of print() function is None i.e. nothing. This is passed as argument to the outer print function which converts it into string and prints the second line of output as None.
Answered By
5 Likes
Related Questions
What will be the output produced by following code ?
>>> str(print())+"One"
What will be the output produced by following code ?
>>> str(print("hello"))+"One"
What will be the output produced by following code ?
>>> print (print ("Hola", end = ""))
Carefully look at the following code and its execution on Python shell. Why is the last assignment giving error ?
>>> a = 0o12 >>> print(a) 10 >>> b = 0o13 >>> c = 0o78 File "<python-input-41-27fbe2fd265f>", line 1 c = 0o78 ^ SyntaxError : invalid syntax