Python Programming - Functions
Exercise : Functions - General Questions
- Functions - General Questions
36.
What does the term "lambda function" refer to?
Answer: Option
Explanation:
A lambda function in Python is a concise way to define a function with a single line of code.
37.
What is the purpose of the
sum()
function?
Answer: Option
Explanation:
The
sum()
function is used to compute the sum of elements in an iterable, such as a list.
38.
What does the term "function signature" refer to?
Answer: Option
Explanation:
The function signature in Python includes the name of the function, along with the parameters and their types.
39.
What is the purpose of the
isinstance()
function?
Answer: Option
Explanation:
The
isinstance()
function is used to check if a variable is of a certain type.
40.
What will be the output of the following code snippet?
def greet(name="User"):
return f"Hello, {name}!"
message = greet()
print(message)
Answer: Option
Explanation:
The default value for the parameter
name
is "User," so if no argument is provided, it uses the default.
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers