Python Subtraction Operator
In Python, Arithmetic Subtraction Operator takes two operands and returns the difference of second operand from first operand.
Syntax
The syntax to find the subtraction of two numbers: a
and b
using Subtraction Operator is
</>
Copy
a - b
The above expression returns a number.
Example
In the following program, we take two numbers: a, b; and find the difference a - b
.
main.py
</>
Copy
a = 5
b = 4
result = a - b
print(result)
Output
1
Conclusion
In this Python Tutorial, we learned about Subtraction Arithmetic Operator, its syntax, and usage, with examples.