MCPcopy Create free account
hub / github.com/Mrinank-Bhowmick/python-beginner-projects / addition

Function addition

projects/Calculator/main.py:8–12  ·  view source on GitHub ↗

This function asks the user to enter a series of numbers separated by spaces. It then adds all the numbers together and returns the result.

()

Source from the content-addressed store, hash-verified

6
7
8def addition():
9 """This function asks the user to enter a series of numbers separated by spaces.
10 It then adds all the numbers together and returns the result."""
11 nums = list(map(int, input("Enter all numbers separated by space: ").split()))
12 return sum(nums)
13
14
15def subtraction():

Callers 1

main.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected