adplus-dvertising
frame-decoration

Question

What is the output of the below program?
def sayHello():
    print('Hello World!') 
sayHello() 
sayHello()

a.

Hello World!
Hello World!

b.

‘Hello World!’
‘Hello World!’

c.

Hello
Hello

d.

None of the mentioned

Posted under Python

Answer: (a).Hello World!
Hello World!

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of the below program?

Similar Questions

Discover Related MCQs

Q. Which are the advantages of functions in python?

Q. What are the two main types of functions?

Q. Where is function defined?

Q. What is called when a function is defined inside a class?

Q. Which of the following is the use of id() function in python?

Q. Which of the following refers to mathematical function?

Q. Python supports the creation of anonymous functions at runtime, using a construct called __________

Q. Does Lambda contains return statements?

Q. What is a variable defined outside a function referred to as?

Q. What is a variable defined inside a function referred to as?

Q. If a function doesn’t have a return statement, which of the following does the function return?

Q. If b is a dictionary, what does any(b) do?

Q. The function complex(‘2-3j’) is valid but the function complex(‘2 – 3j’) is invalid. State whether this statement is true or false.

Q. Which of the following functions does not necessarily accept only iterables as arguments?

Q. Which of the following functions will not result in an error when no arguments are passed to it?

Q. Which of the following functions does not throw an error?

Q. Which of the following is a features of DocString?

Q. Lambda is a statement.

Q. Lambda contains block of statements.