Shorthand Python Boolean value, shorthand python Boolean Value

Source: Internet
Author: User

Shorthand Python Boolean value, shorthand python Boolean Value

In python. Boolean values include true and False. True equals to true, and False equals to error. Note that uppercase and lowercase letters are strictly required in python. The first letter of true and False must be capitalized.

Boolean values can be operated on each other and are calculated using and not or (all in lower case.

And is an operation,

>>> Ture and TureTure >>>> False and TureFalse >>> False and FalseFalse

In the and operation, the result is true only when all values are true. The opposite is False.

Or is or,

>>> True or TureTure >>>> true or FalseTure >>> False or FalseFalse

In the or operation, if one is true, the result is true.

The not operation is not an operation,

>>> Not TureFalse >>> not FalseTure >>> not 1 <2 Ture

Non-calculation is a single object operator. As the name suggests, true and False are converted to each other.

Summary

The above is all about the shorthand Python Boolean value in this article. I hope it will be helpful to you. If you are interested, go to this site: Share the verification code Image Code on the Python web, crawl a Python crawler instance to get a funny Website Section, and share the code after logging on to the Python basic exercise user, if you have any questions, you can leave a message at any time. The editor will reply to you in a timely manner. Thank you for your support!

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.