6/14 - Introduction to Bitwise Operators (What is wrong?)


#1

I followed all the instructions but it didnt work!!!
What is wrong?

shift_right = 0b1100
shift_left = 0b1

Your code here!

shift_right = 0b1100 >> 2 == 0b11
shift_left = 0b1 << 2 == 0b100

print bin(shift_right)
print bin(shift_left)


#2

This worked for me

shift_right = 0b1100
shift_left = 0b1

Your code here!

shift_right = shift_right >> 2
shift_left = shift_left << 2

print bin(shift_right)
print bin(shift_left)


#3

shift_right = 0b1100
shift_left = 0b1

Your code here!

shift_right = 0b1100 >> 2
shift_left = 0b1 << 2

print bin(shift_right)
print bin(shift_left)

this is what worked for me!