Home>Article>Backend Development> 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!