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.
()
| 6 | |
| 7 | |
| 8 | def 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 | |
| 15 | def subtraction(): |