KnowledgeBoat Logo

Computer Science

What will be the output of following program ?

def display():
    print("Hello", end='')
display()
print("there!")

Python

Python Functions

7 Likes

Answer

Hellothere!

Working

The function display prints "Hello" without a newline due to the end='' parameter. When called, it prints "Hello". Outside the function, "there!" is printed on the same line due to the absence of a newline.

Answered By

2 Likes


Related Questions