Editor settings

General settings

Save settings

Learn to program with Python

Subtracting two numbers #

The minus operator - is used to perform subtraction between two numbers,

For example:

x = 10
y = 5
z = x - y
print(z)  # Output: 5

Exercise #

  • Create a variable x to have the value of 20 by using - sign.
Output will be displayed here