Quick actions

cmd+k|ctrl+k

Navigation

Languages

binary dicimal

Snippet info

Language

Python

Visibility

public

Author

awesome2023

Created

2023-12-15T12:21:54.277203Z

Updated

2023-12-15T12:21:54.277203Z

# Binary representation of 34 and the result of (1 << 5)
binary_34 = bin(34)[2:]
binary_1_shifted_5 = bin(1 << 5)[2:]

print(f'Binary representation of 34: {binary_34}')
print(f'Binary representation of (1 << 5): {binary_1_shifted_5}')

# Bitwise OR operation
result_binary = bin(34 | (1 << 5))[2:]
result_decimal = 34 | (1 << 5)

print(f'Result of 34 OR (1 << 5) in binary: {result_binary}')
print(f'Result of 34 OR (1 << 5) in decimal: {result_decimal}')
INFO