Name

| (bitwise OR)

Examples
a = 205  # In binary: 11001101
b = 45  # In binary: 00101101
c = a | b  # In binary: 11101101
print(c)  # Prints "237", the decimal equivalent to 11101101
a = 255 << 24  # Binary: 11111111000000000000000000000000
r = 204 << 16  # Binary: 00000000110011000000000000000000
g = 204 << 8   # Binary: 00000000000000001100110000000000
b = 51         # Binary: 00000000000000000000000000110011
# OR the values together: 11111111110011001100110000110011
argb = a | r | g | b
fill(argb)
rect(30, 20, 55, 55)
Description
Syntax
value | value2
Parameters
value1
value2
Related & (bitwise AND)
binary()
Updated on Wed Jan 18 17:32:21 2017.
Creative Commons License