python--operator

Source: Internet
Author: User

Arithmetic operators

Take surplus

(% b);   #1

Take the Divide

+// b);   #2

logical operators

Print (01);     #0print (01);      #11);        0);       #True

Logical operators can also be used to compare sizes

;p rint (large andsmall);     #print (large or small);      #print (not small);       #False

As a result, these three operators return a bool value that is normal, can also return 0/1, and can be used in comparison to size.

The member operator determines whether the member variable is in the object

List1 = ["mem1""mem2"];p rint ("  mem2" in list1);     #Trueprint ( in list1);     #False

The identity operator identity operator is used to compare storage units of two objects

python--operator

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.