How can I type the OR operator || (also called pipe)

Would be great if this section had a short mention of how to type the || on the eyboard.

3 Likes

The operator for logical OR is actually two characters, not one. Look for the pipe character, | on your keyboard. On a standard American keyboard it’s usually on the backslash \ key. Shift that and you get |.

12 Likes

Mine is Danish, but I found it. Thanks

2 Likes

For reference, what key did you find it on?

1 Like

Yes, it’s the key left of the backspace. It has the following symbols on it ´ `. pressing alt gr annd that will give a pipe |

3 Likes

I use a Spanish keyboard and on that the pipe character | is on the same key for 1 and !. You get | by holding down Alt Gr

i.e.

| = Alt Gr + 1

3 Likes

Hi there! On a French MacBook Pro keyboard the pipe character is shift + alt + L.

3 Likes

On mac with a Danish keyboard it is option + i twice.

Finnish keyboard it is located on left next to the letter Z. Alt gr + that key will result to |.

If you still cant find | you can get it by using your number pad on your keyboard and alt. (make sure you have Number Lock on). So to get the symbol | you hold down alt then while holding it down put in 124 (on your number pad) and let go of alt . This should get the symbol you need. Do this twice to get what you need.

2 Likes

Thanks alt codes are so much easier

Thank you! My old laptop had this key to the left of Z, but i bought a desktop and my new keyboard doesn’t have anything between Shift and Z. It’s a brazilian keyboard.