python inside arithmetic usage

In general the usual arithmetic in our common "+", "-", "*", "/" are common, but normal again, but it's not the same arithmetic There is a point, just get started learning, also said do not know, first I recorded understand.

E.g:

>>>3+2

5 calculated "and"

>>>3-1

2 calculated "difference"

>>>3*6

18 calculated "product"

>>>18/6

3 calculated "business"

When a multi-division becomes slash when the calculated value is a different matter.

E.g:

>>>8//3   

2 The calculated value is "commercial" results rather than the remainder, that remainder how to get it?

here:

>>> 9% 2 course is called "take the remainder."

Values ​​obtained in this calculation is a remainder, it is calculated break%

The power of the algorithm is the same concept and division

>>>2**10

1024 power calculated "plot"

In addition PYTHON most priority turned out to be a small parenthesis (), according to my understanding is infinite increase parentheses to get priority.

E.g:

>>> 5 * 2 + 5 like this question, it is first to take the priority value added here to 2 + 5 becomes parentheses:

>>> (2 + 5) * 5 This made the small brackets priority algorithm. Another example:

>>> ((2 + 5) * 5) * (9 + 9) like this method of adding parentheses

White novice, just beginning to learn PYTHON, limited ability to understand, the great God who also requested Mo joke.

Guess you like

Origin www.cnblogs.com/weslychen/p/12318255.html