Question

In Python, you have the opportunity either to use a predefined function/method or to write a...

In Python, you have the opportunity either to use a predefined function/method or to write a user-defined function/method. In this discussion, provide at least three criteria that would be used to develop an appropriate method of your choice and the rationale behind the selection of these criteria. Then provide an example of your method declaration and return type. Actively participate in this discussion by providing constructive feedback on the criteria, rationales, and examples posted by your peers. Provide at least one reference to support your findings.

Homework Answers

Answer #1

Answer:

There are following criteria to develop an appropriate method :

  • Start with keyword def followed by function name. Name should not be python keyword.
  • Add parameters inside paranthesis if any. End line with semicolon.
  • Add lines of statements that function will execute.
  • End function with return keyword followed by object/value you want to return. Without return statement, function will return None object.

Example :

def hello():
print("Hello World")
return 1

Please actively participate in this discussion by providing constructive feedback on the criteria, rationales, and examples posted by your peers.

Hope you like it

Any Query? Comment Down!

I have written for you, Please upvote the answer as it encourage us to serve you Best !

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
java CLASS DESIGN GUIDELINES 1. Cohesion • [✓] A class should describe a single entity, and...
java CLASS DESIGN GUIDELINES 1. Cohesion • [✓] A class should describe a single entity, and all the class operations should logically fit together to support a coherent purpose. • [✓] A single entity with many responsibilities can be broken into several classes to separate the responsibilities. 2. Consistency • [✓] Follow standard Java programming style and naming conventions. Choose informative names for classes, data fields, and methods. A popular style is to place the data declaration before the constructor...
Plagiarism Certification Tests for Undergraduate College Students and Advanced High School Students These tests are intended...
Plagiarism Certification Tests for Undergraduate College Students and Advanced High School Students These tests are intended for undergraduate students in college or those under 18 years of age. Read these directions carefully! The below test includes 10 questions, randomly selected from a large inventory. Most questions will be different each time you take the test, You must answer at least 9 out of 10 questions correctly to receive your Certificate. You have 40 minutes to complete each test, and you...
Using the model proposed by Lafley and Charan, analyze how Apigee was able to drive innovation....
Using the model proposed by Lafley and Charan, analyze how Apigee was able to drive innovation. case:    W17400 APIGEE: PEOPLE MANAGEMENT PRACTICES AND THE CHALLENGE OF GROWTH Ranjeet Nambudiri, S. Ramnarayan, and Catherine Xavier wrote this case solely to provide material for class discussion. The authors do not intend to illustrate either effective or ineffective handling of a managerial situation. The authors may have disguised certain names and other identifying information to protect confidentiality. This publication may not be...
Delta airlines case study Global strategy. Describe the current global strategy and provide evidence about how...
Delta airlines case study Global strategy. Describe the current global strategy and provide evidence about how the firms resources incompetencies support the given pressures regarding costs and local responsiveness. Describe entry modes have they usually used, and whether they are appropriate for the given strategy. Any key issues in their global strategy? casestudy: Atlanta, June 17, 2014. Sea of Delta employees and their families swarmed between food trucks, amusement park booths, and entertainment venues that were scattered throughout what would...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT