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

Method add

Calculator with simple ui.py:8–20  ·  view source on GitHub ↗

This function adds two numbers. Examples: >>> add(2, 3) 5 >>> add(5, 9) 14 >>> add(-1, 2) 1

(self, num1, num2)

Source from the content-addressed store, hash-verified

6 pass
7
8 def add(self, num1, num2):
9 """
10 This function adds two numbers.
11
12 Examples:
13 >>> add(2, 3)
14 5
15 >>> add(5, 9)
16 14
17 >>> add(-1, 2)
18 1
19 """
20 return num1 + num2
21
22 def subtract(self, num1, num2):
23 """

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected