KnowledgeBoat Logo

Computer Science

What will be the output produced by following code ?

>>> print (print ("Hola", end = ""))

Python

Python Funda

8 Likes

Answer

Output

HolaNone

Explanation

First, print ("Hola", end = "") function is executed which prints Hola. As end argument is specified as "" so newline is not printed after Hola. The next output starts from the same line. 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 None in the same line after Hola.

Answered By

3 Likes


Related Questions