Files
developer-roadmap/roadmaps/datastructures-and-algorithms/content/functions@Cu08m5JOfvrPUDGony144.md
T
Arik Chakma 274082fd77 feat: clean roadmap content and sync scripts (#10181)
* refactor: clean to roadmap content

* refactor: move shared helpers into scripts/lib
2026-07-28 05:45:17 +06:00

792 B

Functions

Functions in programming are named sections of a program that perform a specific task. They allow us to write a piece of code once and reuse it in different places throughout the program, making our code more modular and easier to maintain. Functions often take in input, do something with it, and return output. Functions can be categorized into four main types:

  • Built-in functions: provided by the programming language, like print() in Python.
  • User-defined functions: written by the user for a specific use case.
  • Anonymous functions: also known as lambda functions, which are not declared using the standard keyword (def in Python, for example).
  • Higher-order functions: functions that take other functions as arguments or return a function.