Home>Article>Backend Development> In python or how to express

In python or how to express

藏色散人
藏色散人 Original
2019-06-27 10:21:21 33628browse

In python or how to express

How to express or in python?

Or in python is represented by "or", and the logical expression is x or y.

"or" description:

Boolean "or", if x is non-0, it returns the value of x, otherwise it returns the calculated value of y.

The Python language supports logical operators. Assume that variable a is 10 and b is 20:

(a or b) returns 10.

Related recommendations: "Python Tutorial"

The above is the detailed content of In python or how to express. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn