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

Function subtraction

projects/Calculator/main.py:15–21  ·  view source on GitHub ↗

This function asks the user to enter two numbers. It then subtracts the second number from the first and returns the result.

()

Source from the content-addressed store, hash-verified

13
14
15def subtraction():
16 """This function asks the user to enter two numbers.
17 It then subtracts the second number from the first and returns the result."""
18 n_1 = float(input("Enter first number: "))
19 n_2 = float(input("Enter second number: "))
20
21 return n_1 - n_2
22
23
24def multiplication():

Callers 1

main.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected