Editor settings

General settings

Save settings

Learn to program with Python

Adding two numbers together #

In Python, the plus operator + is used to add two numbers together. It works with both integers and floats. When using the + operator with two numbers, Python adds them together and returns the sum.

For example:

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

Exercise #

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