Question

python programming. what is reuse? How is it used in programming? Is reuse a good thing;...

python programming.

what is reuse? How is it used in programming? Is reuse a good thing; please explain.

Homework Answers

Answer #1
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()
Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
*Python Programming* Design and implement a TimeDate ADT that can be used to represent both a...
*Python Programming* Design and implement a TimeDate ADT that can be used to represent both a date and time as a single entity. *implement intersect() and difference()*
What is the purpose of carrying inventory? Is inventory a good thing or a bad thing?
What is the purpose of carrying inventory? Is inventory a good thing or a bad thing?
Define what is meant by reuse and explain the three basic steps involved in software reuse?...
Define what is meant by reuse and explain the three basic steps involved in software reuse? (Abstraction, storage, and recontextualization)
please explain how learning linear programming will be used in a business major in 100-150 words
please explain how learning linear programming will be used in a business major in 100-150 words
In regards to Python programming, what are some methods that will aid secure the data-in-transit and...
In regards to Python programming, what are some methods that will aid secure the data-in-transit and at-rest? Also, what are some examples?
* What are antioxidants? Why is that a good thing to advertise in a product? And...
* What are antioxidants? Why is that a good thing to advertise in a product? And why do we need ANTI-oxidants? What is oxidation? * Describe the term “nitrogen-fixing”. Why is nitrogen important for legumes? What is it used for in the plant? * California grows a lot of rice, especially in the areas north of Sacramento. Describe how rice is grown and harvested. * What is biodiesel and why is it “trendy” or popular today? * Pretend you are...
Python Programming Q : Please solve the problem.   ************* my grade ************* ****performance records***** print() 95-100:...
Python Programming Q : Please solve the problem.   ************* my grade ************* ****performance records***** print() 95-100: A+      90- 94: A 95-89: B+ ************** print() Your grade is B+.
Use python programming: Capitalise first letter of each word "hello programmer" becomes Hello Programmer. Explain each...
Use python programming: Capitalise first letter of each word "hello programmer" becomes Hello Programmer. Explain each line of code through comments
what would be a good thing about pH changes along digestive tract
what would be a good thing about pH changes along digestive tract
THIS PYTHON PROGRAMMING On a chessboard, positions are marked with letters between a and h for...
THIS PYTHON PROGRAMMING On a chessboard, positions are marked with letters between a and h for the column and a number between 1 and 8 for the row. The first place on the board, a1, is black. The next is white, alternating across a row. Odd rows start with black, even rows start with white. Given a 2 character input string with a letter (a-h) and a number (1-8), print "Black" or "White" indicating if the square is black or...