What operators are there in Python
Editor to share with you what operators in Python, I believe most people do not know much, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Arithmetic operator description example + add-two objects add a + b output 30-minus-get a negative number or a number minus another number a-b output result-10 * multiply-multiply two numbers or return a string a * b output result 200 / division-x divided by yb / an output 2% modulus-return division The remainder b% an outputs the result 0x * power-returns the power of x to the power of 10 to the power of 20 Output result 100000000000000000000Rank / rounding division-the integer part of the return quotient-the integer part of the return quotient-output result 4,9.0 prime 2.0 output result 4.0 comparison operator description instance = = equal-compare whether the object is equal (a = = b) returns False. ! = not equal-compares whether two objects are not equal (a! = b) returns true. Not equal-compares whether two objects are not equal (a / b) returns true. This operator is similar to! =. > greater than-returns whether x is greater than y (a > b) returns False. = greater than or equal to-returns whether x is greater than or equal to y. (a > = b) returns False. > 2 output result 15, binary explanation: more than 0000 1111 are all the contents of this article "what operators are there in Python". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!