See More


<\/p>\",\"created_on\":\"2025-06-03 - 11:36:39\",\"updated_on\":\"2025-06-03 - 11:59:51\"},{\"id\":154435,\"title\":\"First Class functions in Python-question-2\",\"slug\":\"first-class-functions-in-python-question-2\",\"question\":\"

In the context of first-class functions, what is a higher-order function?<\/span><\/p>\",\"answers\":[{\"id\":590306,\"answer\":\"

A function that can only return primitive data types.<\/span><\/p>\",\"correct\":false,\"sort_order\":0},{\"id\":590307,\"answer\":\"

A function that can take other functions as arguments or return them as results.<\/span><\/p>\",\"correct\":true,\"sort_order\":1},{\"id\":590308,\"answer\":\"

A function that is defined within another function but cannot be returned.<\/span><\/p>\",\"correct\":false,\"sort_order\":2},{\"id\":590309,\"answer\":\"

A function that executes in a separate thread.<\/span><\/p>\",\"correct\":false,\"sort_order\":3}],\"explanation\":\"


<\/p>\",\"created_on\":\"2025-06-03 - 11:36:39\",\"updated_on\":\"2025-06-03 - 12:00:32\"},{\"id\":154436,\"title\":\"First Class functions in Python-question-3\",\"slug\":\"first-class-functions-in-python-question-3\",\"question\":\"

What will be the output of the following code?<\/span><\/p>

def greet(name):<\/span><\/p>

return f\\\"Hello, {name}\\\"<\/span><\/p>


<\/p>

say_hello = greet<\/span><\/p>

print(say_hello(\\\"Geek\\\"))<\/span><\/p>\",\"answers\":[{\"id\":590310,\"answer\":\"

Hello, greet<\/span><\/p>\",\"correct\":false,\"sort_order\":0},{\"id\":590311,\"answer\":\"

greet<\/span><\/p>\",\"correct\":false,\"sort_order\":1},{\"id\":590312,\"answer\":\"

Hello, Geek<\/span><\/p>\",\"correct\":true,\"sort_order\":2},{\"id\":590313,\"answer\":\"

TypeError<\/span><\/p>\",\"correct\":false,\"sort_order\":3}],\"explanation\":\"

Functions can be assigned to variables. Here, say_hello becomes another reference to greet.<\/span><\/p>\",\"created_on\":\"2025-06-03 - 11:36:39\",\"updated_on\":\"2025-06-03 - 12:01:58\"},{\"id\":154437,\"title\":\"First Class functions in Python-question-4\",\"slug\":\"first-class-functions-in-python-question-4\",\"question\":\"

Which of the following is not a property of first-class functions?<\/span><\/p>\",\"answers\":[{\"id\":590314,\"answer\":\"

Functions can be stored in data structures<\/span><\/p>\",\"correct\":false,\"sort_order\":0},{\"id\":590315,\"answer\":\"

Functions can be assigned to variables<\/span><\/p>\",\"correct\":false,\"sort_order\":1},{\"id\":590316,\"answer\":\"

Functions can return other functions<\/span><\/p>\",\"correct\":false,\"sort_order\":2},{\"id\":590317,\"answer\":\"

Functions can only return primitive types<\/span><\/p>\",\"correct\":true,\"sort_order\":3}],\"explanation\":\"

First-class functions can return any type, including other functions\u2014not limited to primitives.<\/span><\/p>\",\"created_on\":\"2025-06-03 - 11:36:39\",\"updated_on\":\"2025-06-03 - 12:03:46\"},{\"id\":154438,\"title\":\"First Class functions in Python-question-5\",\"slug\":\"first-class-functions-in-python-question-5\",\"question\":\"

What will be the output of this code?<\/span><\/p>

def outer():<\/span><\/p>

def inner():<\/span><\/p>

return \\\"Inner function\\\"<\/span><\/p>

return inner<\/span><\/p>

func = outer()<\/span><\/p>

print(func())<\/span><\/p>\",\"answers\":[{\"id\":590318,\"answer\":\"

Inner function<\/span><\/p>\",\"correct\":true,\"sort_order\":0},{\"id\":590319,\"answer\":\"

inner<\/span><\/p>\",\"correct\":false,\"sort_order\":1},{\"id\":590320,\"answer\":\"

outer<\/span><\/p>\",\"correct\":false,\"sort_order\":2},{\"id\":590321,\"answer\":\"

Error<\/span><\/p>\",\"correct\":false,\"sort_order\":3}],\"explanation\":\"

outer() returns the inner function, and func() calls it, returning its string.<\/span><\/p>\",\"created_on\":\"2025-06-03 - 11:36:39\",\"updated_on\":\"2025-06-03 - 12:05:13\"},{\"id\":154439,\"title\":\"First Class functions in Python-question-6\",\"slug\":\"first-class-functions-in-python-question-6\",\"question\":\"

Which of the following is NOT a characteristic of first-class functions?<\/span><\/p>\",\"answers\":[{\"id\":590322,\"answer\":\"

They can be assigned to variables.<\/span><\/p>\",\"correct\":false,\"sort_order\":0},{\"id\":590323,\"answer\":\"

They can be passed as arguments to other functions.<\/span><\/p>\",\"correct\":false,\"sort_order\":1},{\"id\":590324,\"answer\":\"

They can only be defined once in a program.<\/span><\/p>\",\"correct\":true,\"sort_order\":2},{\"id\":590325,\"answer\":\"

They can be returned from other functions.<\/span><\/p>\",\"correct\":false,\"sort_order\":3}],\"explanation\":\"


<\/p>\",\"created_on\":\"2025-06-03 - 11:36:39\",\"updated_on\":\"2025-06-03 - 12:06:14\"},{\"id\":154440,\"title\":\"First Class functions in Python-question-7\",\"slug\":\"first-class-functions-in-python-question-7\",\"question\":\"

What is the output of the following code?<\/span><\/p>

def make_multiplier(n):<\/span><\/p>

def multiplier(x):<\/span><\/p>

return x * n<\/span><\/p>

return multiplier<\/span><\/p>

double = make_multiplier(2)<\/span><\/p>

print(double(5))<\/span><\/p>\",\"answers\":[{\"id\":590326,\"answer\":\"

7<\/span><\/p>\",\"correct\":false,\"sort_order\":0},{\"id\":590327,\"answer\":\"

10<\/span><\/p>\",\"correct\":true,\"sort_order\":1},{\"id\":590328,\"answer\":\"

25<\/span><\/p>\",\"correct\":false,\"sort_order\":2},{\"id\":590329,\"answer\":\"

Error<\/span><\/p>\",\"correct\":false,\"sort_order\":3}],\"explanation\":\"

make_multiplier(2) returns a function that multiplies its argument by 2. So, double(5) returns 10.<\/span><\/p>


<\/p>


<\/p>\",\"created_on\":\"2025-06-03 - 11:36:39\",\"updated_on\":\"2025-06-03 - 12:07:33\"},{\"id\":154441,\"title\":\"First Class functions in Python-question-8\",\"slug\":\"first-class-functions-in-python-question-8\",\"question\":\"

How does Python treat functions with respect to variables?<\/span><\/p>\",\"answers\":[{\"id\":590330,\"answer\":\"

Functions are static objects<\/span><\/p>\",\"correct\":false,\"sort_order\":0},{\"id\":590331,\"answer\":\"

Functions are constants and cannot be reassigned<\/span><\/p>\",\"correct\":false,\"sort_order\":1},{\"id\":590332,\"answer\":\"

Functions are first-class citizens and can be stored, passed, and reassigned<\/span><\/p>\",\"correct\":true,\"sort_order\":2},{\"id\":590333,\"answer\":\"

Functions must be declared global to be used<\/span><\/p>\",\"correct\":false,\"sort_order\":3}],\"explanation\":\"

Being first-class citizens means functions can be assigned, passed, and returned like other objects.<\/span><\/p>\",\"created_on\":\"2025-06-03 - 11:36:39\",\"updated_on\":\"2025-06-03 - 12:09:57\"}],\"quiz\":{\"id\":10547,\"top_description\":\"First Class functions in Python\",\"question_count\":8,\"bottom_description\":\"\",\"title\":\"First Class functions in Python\",\"slug\":\"first-class-functions-in-python\",\"category\":[{\"id\":1842,\"name\":\"Python\",\"slug\":\"python\",\"origin_term_id\":1789,\"origin_slug\":\"programming-language\/python\"}],\"show_answer\":1,\"created_on\":\"2025-06-03 - 11:36:39\",\"updated_on\":\"2025-06-03 - 12:12:30\"}}"); First Class functions in Python - GeeksforGeeks