Question

I need to answer these test questions Choose all of the following which are benefits of using meaningful names in writing clean code. Always use abbreviations to kWhat are some considerations to keep in mind when doing code review? How do I reduce the number of iterations in a loop? Is mFinish the following sentence: Generally, if theres an and in your function name, consider ------ Renaming Refactoring AddAfter a GAN is trained, which parts of it are used to generate new outputs from data? Neither Discriminator Generator Both ge

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer

writing good code is a matter of experience, but on looking on the suggestion by the good programmers  we can code our programs beautifully . Below are some of the methods:

  1. using abbreviations:we can use abbreviations on naming variables,functions, classes and methods while coding.this saves the time and makes the code easy to readable for others .Although some programming functions have in-build functions as abbreviation . in python while defining a function we use the keyword "def" along its name.
  2. using different names: it is very important to use different names while writing a code. a program can a have multiple functions and to call a specific functions ,we have to mention its name in the functions call then only we can .it is good programming practice and and makes it easy to debug the program easily.
  3. using descriptive names: while writing the code for a program, we should use the name the of the variable, functions in such a way that they describe themselves. a variable name should justify itself what it stands for.like for addition , we use the variable add, and for similar other tasks.
  4. simplicity : it is the main attribute of the well crafted programs.using complex approach while programming makes it difficult fot the others to work on it like in the testing.the code should be as pleasing that the reader should smile while reading the code.

Magic methods :

in python we can use magic methods which are invoked internally from a class to a action. the magic method can be defines as _method_. some of the examples are

_init_, _add_, _len_ etc

  • true, _init_ is a magic method

Ans) yes, we can bring multiple actions together by using the function. function reduces the time complexity of the program and makes it easy to debug.

Ans) characteristic of a good code are:

  • Readable
  • efficiency
  • Robustness
  • portability
  • maintainability
Add a comment
Know the answer?
Add Answer to:
I need to answer these test questions Choose all of the following which are benefits of...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 1) Finish the following sentence: Generally, if there's an "and" in your function name, consider ______....

    1) Finish the following sentence: Generally, if there's an "and" in your function name, consider ______. Arguing Adding additional modules Abstracting Renaming Refactoring 2) Is this a good log message? `2018-08-19 | scheduler | ERROR | sampleco.com.jobs.scheduledtasks | Scheduled job 'ID ABC23' failed due to binary incompatibilities` FALSE TRUE 3) After a GAN is trained, which parts of it are used to generate new outputs from data? Both generator and discriminator Generator Discriminator Neither

  • All questions are multi answer (choose two or more options). 6.When formatting cells, which of the...

    All questions are multi answer (choose two or more options). 6.When formatting cells, which of the following are true about the number category? a. can have up to 5 decimal places b. formats without an asterisk are not affected by operating system settings c. can include general d. can include number e. can have up to 255 decimal places 7.In Excel, which of the following are not true about the IF function? a. It can have two results b. It...

  • Which of the following is NOT true about changing field names in a query? A) Field...

    Which of the following is NOT true about changing field names in a query? A) Field names in aggregate queries are a composite of the selected aggregate function and the table field name. B) The field names assigned in an aggregate query can easily be changed either before or after the query is run. C) You must keep the original field name in the query design grid so Access knows what field to perform the calculation on. D) The default...

  • please chooose all corrct answers to the question( it could be more than one corrct answers):-...

    please chooose all corrct answers to the question( it could be more than one corrct answers):- Q1) What are the best practices for building out good unit tests? - You do not need an assert statement for each edge case. - Write a test function to check for implementation given all parameters. - Have multiple assert statements to test for all edge cases. - Think about all edge cases before you write the function. - Run a test function to...

  • Please answer for all the subparts, explaination is not necessary, only answers will suffice. 1) How...

    Please answer for all the subparts, explaination is not necessary, only answers will suffice. 1) How many startDocument events and how many startElement events will be fired when the following XML SAX parser? <a> <b q='yyy'>zzz</b> <c>nnn</c> <d>ppp</d> </a> a) O startDocument events and 4 startElement events b) O startDocment events and 3 startElement events c) 1 startDocment events and 4 start Element events d) 1 startDocment events and 3 startElement events 2) The bracket in the following is an...

  • Python Programming QUESTION 16 Which of the following is an example of a Keyword in Python?...

    Python Programming QUESTION 16 Which of the following is an example of a Keyword in Python? elif class for All of the above QUESTION 17 Which of the following is not an acceptable variable name in Python? 2ndVar $amount Rich& ard None of the above are acceptable variable names QUESTION 18 The number 1 rule in creating programs is ___________________- Write the code first Think before you program Let the compiler find you syntax errors There are no rules just...

  • Del Python is (choose all that apply) ext) call takes three arguments, senders e-mail receiver's e-mail and the e-mail text. A) Used in Scientific Applications D) Compiled Language 7, help) f...

    Del Python is (choose all that apply) ext) call takes three arguments, senders e-mail receiver's e-mail and the e-mail text. A) Used in Scientific Applications D) Compiled Language 7, help) function call will open a different shell in Python shell We can run Python applications using Python Shell, IDLE and Command Line. A) True Dy False AT Thue B) False 8. Suppose that you have a Python file myApplication.py. You can run it by (choose all that apply) -3. To...

  • Please I need Help with this question, 1. Which of the following is a method tocreatea...

    Please I need Help with this question, 1. Which of the following is a method tocreatea new table inMS Access? A All the answers b. Using Design View c. CreateTable Wizard d. Directly Entering Data 1. Which field type will you select if you need to enter long text in that field? a Currency b Text c Hyperlink d Memo 1. The columns in a microsoft access table are also called _______ a Fields b Rows c Records d Columns...

  • Python Programming The strip() method allows you to __________________. remove characters insert characters replace characters none...

    Python Programming The strip() method allows you to __________________. remove characters insert characters replace characters none of the above QUESTION 2 Text files contain Unicode characters and are human readable. True False QUESTION 3 Passing mutable objects does not allow a function to change values in the calling program. True False QUESTION 4 Python uses an _______________ to execute each line of code one at a time. compiler interpreter engraver importer QUESTION 5 The Intersection operator for a set is...

  • I need all the questions to answer, please True or False: Synchronized cardioversion is appropriate for...

    I need all the questions to answer, please True or False: Synchronized cardioversion is appropriate for treating an unknown wide complex tachycardia. True False True or False: A nasopharyngeal airway (NPA) can be used on a semi-conscious or conscious individual, while an oropharyngeal airway (OPA) should only be used on an unconscious individual. True False True or False: Any bradycardia less than 60 beats per minute is a pathologic event. True False True or False: Transcutaneous pacing should be used...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT