Functions are blocks of code that perform tasks and are called when needed. User-defined functions in Python are created using the def keyword. Functions make code reusable, increase readability and modularity. Variables inside functions have local scope unless declared as global or nonlocal. Functions can take arguments and return values. Libraries contain many built-in functions for tasks like math operations and string manipulation.