Python|The use of operators

Problem Description

The operators supported by Python mainly include eight operators such as arithmetic, assignment, and comparison. Simple operations can be performed through operators. Operators are not difficult but need to be accurately mastered.

solution

First, you need to master the meaning of various operators, learn the examples in the tutorial, and then practice a few times one by one after you understand, and then compare the examples to find the problems and continue to explore.

1 Arithmetic operators

Master the use of operators such as “+” “-” “*” “/” “%” “**” “//”


username:' or updatexml(1,concat(0x7e,database()),1),1)#

password: just enter

2 Comparison operator

Just like ab, two different variables, to compare these two variables, there are operators such as "==""!="">", if correct, it will return true or 1, and vice versa


a=1

b=2if  a==b

 print("A equals b")else:print("A is not equal to b")

3 Assignment operator

Use addition and subtraction methods to assign values to variables, with operators such as "=", "+=", and "-="


a=5

b=2

c=0

c=a+b

print("The value of c is:",c)

Conclusion

Before performing operations, familiarize and memorize each operator. Don't make mistakes when entering, master basic operator calculations, and correct them in time based on examples.

END

Edit | Wang Wenxing

Editor | Cha Mengyu

Recommended Posts

Python|The use of operators
Use of Anaconda in Ubuntu
Use of mediawiki under ubuntu
Use of numpy in Python development
What is the use of Python
What is the use of python's pip
Installation and use of Mysql under CentOS
Installation and use of Win10 subsystem Ubuntu