Sandbox:DC: Difference between revisions
Jump to navigation
Jump to search
(Test of DC Info template) |
mNo edit summary |
||
Line 1: | Line 1: | ||
{{DC_Info | {{DC_Info | ||
|objective= | |||
This function shall add two values and therefore simplify one of the most complex arithmetic operations. | |||
|code= | |code= | ||
def add(self,param1,param2): | def add(self,param1,param2): | ||
Line 9: | Line 11: | ||
{{DC_Parameter|param1|The first summand.}} | {{DC_Parameter|param1|The first summand.}} | ||
{{DC_Parameter|param2|The second summand.}} | {{DC_Parameter|param2|The second summand.}} | ||
|executed= | |executed= | ||
Whenever the program flow detects that a sum is required, this function is called. There is one exception: When the second argument is negative, sub() is called instead. | Whenever the program flow detects that a sum is required, this function is called. There is one exception: When the second argument is negative, sub() is called instead. |
Latest revision as of 10:06, 1 December 2017
Objective | This function shall add two values and therefore simplify one of the most complex arithmetic operations. | ||||
Function Definition | def add(self,param1,param2):
sum = param1 + param2
return sum
| ||||
Parameters |
| ||||
Return value | The sum of the two arguments. | ||||
When is function called | Whenever the program flow detects that a sum is required, this function is called. There is one exception: When the second argument is negative, sub() is called instead. | ||||
Comments | Actually, this whole function is not used in production. |