Quotes help make search much faster. Example: "Practice Makes Perfect"

Sunday, December 2, 2012

Codecademy: Slip and Slide


#sample solution


def flip_bit(number, n):
#print number
#print n
#print bin(number)
mask = (0b1 << (n-1))
#print bin(mask)
result = number ^ mask
return bin(result)

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts