Class - 12 CBSE Computer Science Important Output Questions 2025
What will be the output of the following program?
def display():
print ("Hello",)
display()
print("bye!")
Python
Python Functions
1 Like
Answer
Hello
bye!
Working
def display():
— This line defines a function nameddisplay
with no parameters.print("Hello",)
— Inside thedisplay
function, it prints the string "Hello".display()
— This line calls thedisplay
function, which then prints "Hello" due to the print statement inside the function.print("bye!")
— This line prints "bye!" on a new line.
Answered By
2 Likes