What is function? Explain the need for writing a function in Python.
Chapter:2
Functions
and Files
Introduction
to Functions
Basic
Conceptons
•
Function is a block of instructions that performs a specific and well defined
task. This block can be repeatedly called by other programming instruction.
•
Every function is specified by a name.
• Following are some reasons why do we need to use functions in python :
1.
All the logically related statements can be grouped together in one entity.
This makes the program easy to read,
understand and debug.
2.
The repetition of frequently required code can be avoided by using function.
3.
Dividing a long program into functions allows us to debug the parts one at a
time and then assemble them into a working whole.
4.
Once the code of the function is written and tested, we can reuse this code.
Reusability is an important use of function.
1. What is function?
Explain the need for writing a function in Python.
Python for Data Science: Chapter 2: Functions and Files : Tag: Computer Programming, Python, Data Science : - Functions in Python: Basic Conceptons
Python for Data Science
AD25201 2nd Semester AIDS Dept | 2025 Regulation | 2nd Semester 2025 Regulation
English Essentials II
EN25C02 2nd Semester | 2025 Regulation | 2nd Semester 2025 Regulation
Tamils and Technology தமிழர்களும் தொழில்நுட்பமும்
UC25H02 2nd Semester | 2025 Regulation | 2nd Semester 2025 Regulation
Linear Algebra
MA25C02 2nd Semester | 2025 Regulation
Applied Physics (CSIE) II
PH25C03 2nd Semester AIDS, CSE, IT, CSE(CY) Dept | 2025 Regulation | 2nd Semester 2025 Regulation
Digital Principles and Computer Organization
CS25C06 2nd Semester AIDS, CSE, IT, CSE(CY) Dept | 2025 Regulation | 2nd Semester 2025 Regulation
Basic Electrical and Electronics Engineering
EE25C01 2nd Semester | 2025 Regulation | 2nd Semester 2025 Regulation
Python for Data Science
AD25201 2nd Semester AIDS Dept | 2025 Regulation | 2nd Semester 2025 Regulation
Re-Engineering for Innovation
ME25C05 2nd Semester | 2025 Regulation | 2nd Semester 2025 Regulation
Python for Data Science - Laboratory
AD25201 2nd Semester AIDS Dept | 2025 Regulation | 2nd Semester 2025 Regulation