Why do we move repeated code into a function?
- To make the program run slower
- To hide errors
- Because Python requires every line inside a function
- To avoid duplication and make the code easier to test and reuse
Answer
D) To avoid duplication and make the code easier to test and reuse
Functions support decomposition and reuse. SLO CS-11-C-06 · Understanding
Computer Science MCQ · More Unit 3: Programming Fundamentals MCQs · Practise