Skip to content
Home » Python Program to Subtract Two Numbers

Python Program to Subtract Two Numbers

Learn about Python Program to Subtract Two Numbers in the below code example. Also, refer to the comments in the code snippet to get a detailed view about what’s actually happening.

Python Program to Subtract Two Numbers

# Python program to subtract two numbers

num1 = 10
num2 = 2

# subtract two numbers
sub = num1 - num2

# print the result
print('The subtraction of numbers =', sub)

Output:

The subtraction of numbers = 8

Hope above code works for you and Refer the below Related Codes to gain more insights. Happy coding and come back again.

Similar Code : Add Two Numbers in Python Without Using Any Variables