python programming.
what is reuse? How is it used in programming? Is reuse a good thing; please explain.
what is reuse? reuse means using the same code multiple times without writing the same code again and again. How is it used in programming? reuse is done using methods. We can define function once and then use it for multiple times. Is reuse a good thing? Yes, It gives more readability and most efficient. Example: ----------- def divide(a,b): if(b==0): return None else: return a/b def main(): print(divide(4,3)) print(divide(4,0)) main()
Get Answers For Free
Most questions answered within 1 hours.