Quick actions

cmd+k|ctrl+k

Navigation

Languages

bit shifting

Snippet info

Language

Python

Visibility

public

Author

fizznakle

Created

2016-12-28T23:12:51Z

Updated

2016-12-28T23:12:51Z

#check if the 4th from the right is on

def check_bit4(input):
    if input & 0b1000 > 0:
        return "on"
    else:
        return "off"
INFO