You are on page 1of 4

Functions

Introduction to Functions
Large programs are often difficult to manage and so are divided into
smaller units known as functions. A function is simply a group of
statements assigned to a certain name. For example, School
Management software will contain various tasks like Registering
Student, Fee Collection, Library Book Issue, TC Generation or Result
Declaration. In this case we have to create different functions for each
task to maintain the steps of software development. A set of functions is
stored in a file called a “module”. This approach is known as
“modularization”. Commonly used modules are called “libraries”.
mainly two types
1. Built-in Functions
2. User-Defined Functions (UDFs)
3. Anonymous functions, which are also called lambda functions
Built-in Functions
• Built-in functions are the ready-made functions in Python that are
frequently used in programs.
• fname = input("Enter your name: ")
• the name of the function is input(). the function accept both a value
and an argument "Enter your name: “ and return a value s stored in
the variable fname.
• The following is a categorized list of some of the frequently used built-
in functions in Python.
1.Mathemacal Functions:
• abs() min() max() sum() pow() divmod()
Built-in Functions

2. Datatype Conversion:
bool() char() int() dict() float() str() set() ord() list() tuple()
3. Input or Output:
Input() print()
4. Other Functions:
type() len() range()

You might also like