CBSE Class 11 Computer Science Question 40 of 63

Introduction to Python Modules — Question 9

Back to all questions
9
Question

Question 9

A program having multiple functions is considered better designed than a program without any functions. Why?

Answer

A program having multiple functions is considered better designed than a program without any functions due to the following reasons:

  1. Modularity — Functions break the program into smaller, manageable pieces, making it easier to understand and maintain.
  2. Code Reusability — Once defined, functions can be reused in different parts of the program, reducing redundancy.
  3. Improved Debugging — Breaking down code into functions helps in pinpointing and fixing bugs more efficiently.
  4. Simplified Testing — Functions can be individually tested, ensuring each part works as expected.
  5. Enhanced Readability — Functions improve the structure of the program, making the code cleaner and more readable.
  6. Reduced Program Size — Functions help in reducing the size of the program by avoiding code duplication.