Question
Evaluate the code below, and suggest ways to improve it.
def find_sum(num1, num_2):
'''
Finds and returns sum of two numbers
'''
return num1 + num_2
(1 point)
Responses
Instead of returning the sum, the program should just print it onscreen.
Instead of returning the sum, the program should just print it onscreen.
The method has a docstring that is not descriptive enough. The docstring should mention the variables and their descriptions to improve the code.
The method has a docstring that is not descriptive enough. The docstring should mention the variables and their descriptions to improve the code.
The name of this method should be something else.
The name of this method should be something else.
There should be an additional variable defined at the beginning to store the sum, and this value is returned at the end.
def find_sum(num1, num_2):
'''
Finds and returns sum of two numbers
'''
return num1 + num_2
(1 point)
Responses
Instead of returning the sum, the program should just print it onscreen.
Instead of returning the sum, the program should just print it onscreen.
The method has a docstring that is not descriptive enough. The docstring should mention the variables and their descriptions to improve the code.
The method has a docstring that is not descriptive enough. The docstring should mention the variables and their descriptions to improve the code.
The name of this method should be something else.
The name of this method should be something else.
There should be an additional variable defined at the beginning to store the sum, and this value is returned at the end.
Answers
There are no human answers yet.
There are no AI answers yet. The ability to request AI answers is coming soon!
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.