operator classification

1. Arithmetic operation:

-  

** 

// 

2. Comparison operation:

== 

!=

>=
<=

<

3. Member operation:

in

not in

4. Logical operations:

Calculate the parentheses first, the execution order: from front to back, if the result is ture followed by or, there is no need to go back. If the result is ture followed by and, continue to go backwards. If the result is false followed by or , keep going. If the result is false followed by and , don't go.

5. Assignment operation:

count = count + 1 equals count += 1 (another, more convenient way to express it)

Supplement: You can add parentheses to logical operations, and execute the logic in the parentheses first. user == "alex" and (pwd = "123" or 1==1)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325079631&siteId=291194637