MCPcopy Create free account
hub / github.com/geekcomputers/Python / subtract

Method subtract

Calculator with simple ui.py:22–34  ·  view source on GitHub ↗

This function subtracts two numbers. Examples: >>> subtract(5, 3) 2 >>> subtract(9, 5) 4 >>> subtract(4, 9) -5

(self, num1, num2)

Source from the content-addressed store, hash-verified

20 return num1 + num2
21
22 def subtract(self, num1, num2):
23 """
24 This function subtracts two numbers.
25
26 Examples:
27 >>> subtract(5, 3)
28 2
29 >>> subtract(9, 5)
30 4
31 >>> subtract(4, 9)
32 -5
33 """
34 return num1 - num2
35
36 def multiply(self, num1, num2):
37 """

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected