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
xto have the value of 20 by using+sign.
Getting Started with Python
Data Types
Python Functions
Statements in Python
Basic Debugging in Python
Basic Algorithm
Object-Oriented Programming
Error Handling
Intermediate Algorithm
Python Modules