📚 First-Class Functions | First-Class Functions
Functions as objects, higher-order functions, lambda, callable, and parameter kinds
📌 Key Formulas:
1. Functions Are Objects: type(func), func.__name__, func.__doc__
2. Higher-Order Functions: sorted(data, key=func), map(func, iterable)
3. Lambda Expressions: lambda x, y: x + y
4. Callable Objects (__call__): class C: def __call__(self, ...): ...
5. Positional-Only & Keyword-Only Params: def f(a, b, /, c, *, d): ...
⏱️ Timestamps:
0:00 Introduction
0:24 Functions Are Objects
0:53 Higher-Order Functions
1:19 Lambda Expressions
1:48 Callable Objects (__call__)
2:16 Positional-Only & Keyword-Only Params
2:46 Passing Functions as Args
3:09 functools.reduce Factorial
3:29 operator Module
3:56 functools.partial
4:19 Quick Tips & Tricks | टिप्स
4:45 Summary | सारांश
💡 Quick Tips:
• Functions are first-class objects — you can pass, return, and store them anywhere
• Use operator module (itemgetter, attrgetter, mul) instead of simple lambdas
• functools.partial creates specialized functions by freezing some arguments
• Keep lambdas simple — if it needs multiple lines, use a named function instead
📚 Useful for: Python, Interviews, GATE and all govt exams
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📱 Download App: https://play.google.com/store/apps/de...
🌐 Website: https://selectionsathi.com
🔔 Subscribe: / @selectionwithsathi
#SelectionWithSathi #Programming #PythonFirst-ClassFunctions #GovtExam #SSC #Railway #सरकारीपरीक्षा