Page 204 - Computer Science V2.0 Class 11
P. 204
8 INTRODUCTION TO
FUNCTIONS
Chapter Outline
8.1 Built-in Functions 8.2 User-defined Functions
Introduction
You must have seen someone driving a car. Even though a car is a complex entity comprising hundreds of parts which
make it move, the driver drives it easily with a handful of controls which are easy to manage. The manufacturing
process of a car is highly modular. It involves manufacturing and testing various car components at different ancillary
units. Subsequently, they are assembled at the main unit. The modular design of the car makes the process of fault
diagnosis, servicing and maintenance easy to manage.
Just like a car, real-life programming tasks are often highly complex, requiring the efforts of several teams of
programmers for several weeks, months, or years. As the complexity of a programming task increases, so does the
length and complexity of the associated programs, making it difficult to understand, manage, and debug. To manage
a large program for solving a complex problem, we often divide the problem into subproblems and solve each sub-
problem by a sub-program (module). If a subproblem is still very complex, it may be further divided into subproblems.
The process of dividing a complex problem into simple and manageable problems is called stepwise refinement. It
saves a lot of time and effort. The programming methodology that focuses on organising a computer program into
separate blocks of code or sub-programs (each having a name and functionality) is called modular programming. Each
independent unit of code is called a module. In the context of Python, a program file is also called a module or a script.
This chapter will discuss the modular approach to developing programs.
190 Touchpad Computer Science (Ver. 2.0)-XI

