We all know: Python is a powerful programming language, especially in scientific computing. Python can realize almost all kinds of mathematical operations.
Let’s talk about the basic operations of python: addition operation
>>> 3+2 >>> 5
or assignment to a variable
>>> a = 6 >>> b = 9 >>> a + b 15
You can also implement addition operation by defining a function
def func(a,b): return a + b func(8,7) 15
How about it, it looks very simple, but in fact python is so simple and easy to learn, it is also very friendly to beginners, the syntax is concise and easy to understand.
The above is the detailed content of How to perform addition operation in python. For more information, please follow other related articles on the PHP Chinese website!