CBSE Class 12 Computer Science Question 77 of 103

Working with Functions — Question 10

Back to all questions
10
Question

Question 6(iv)

What will be the output of following program ?

def display():
    print("Hello", end='')
display()
print("there!")
Answer
Output
Hellothere!
Explanation

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.