Correct documentation

Report a typo

When writing documentation, it is important to check whether this documentation really corresponds to what the object does.

We implemented the calculate() function and created a docstring for it. Check all the value types in the documentation. Is everything right? You need to change just one word in the description and run the code again.

Write a program in Python 3
def calculate(num_one, num_two):
"""Return the division result for two numbers.

The second number should be greater than or equal to the first one.

Arguments:
num_one -- an integer by which we divide.
num_two -- an integer to be divided by 'num_one'.
Return values:
If the second number is smaller, return the corresponding message.
Otherwise, return the division result as int.
"""
if num_two < num_one:
return 'The second number should be greater than or equal to the first one.'
else:
return num_two / num_one
___

Create a free account to access the full topic