How to type the vertical bar operator in python

little bottle
Release: 2019-05-30 15:50:48
Original
18818 people have browsed it

How to type the vertical bar operator in python

Python’s logical OR operator is ||, which is not a character, but consists of two |. So when playing ||, you need to play two | in a row.

The vertical bar operator "|" is in the upper right corner of the keyboard, and there is a key printed with | and \ below the backspace. Hold down shift and press this key at the same time to type "|".

When typing ||, you can hold down the shift key, press the | key twice, and then lift the shift key.

The operation form of logical OR is: expr1 || expr2

The operation rules are: When expr1 and expr2 are both false, the result is false. Otherwise the result is true.

The above is the detailed content of How to type the vertical bar operator in python. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template