티스토리 뷰
print 5 >> 4 # Right Shift #0
print 5 << 1 # Left Shift #10
print 8 & 5 # Bitwise AND #0
print 9 | 4 # Bitwise OR #13
print 12 ^ 42 # Bitwise XOR #38
print ~88 # Bitwise NOT # -89
shift_right = 0b1100
shift_left = 0b1
# Your code here!
shift_right = shift_right >> 2
shift_left = shift_left << 2
print bin(shift_right) #3
print bin(shift_left) #4
'IT > Python: Codecademy' 카테고리의 다른 글
12 File Input and Output and Finish course (0) | 2018.03.19 |
---|---|
11 Introduction to Classes (0) | 2018.03.10 |
10 Advanced Topics in Python (0) | 2018.03.07 |
9 Exam Statistics (0) | 2018.03.06 |
8 Loop (0) | 2018.02.28 |
댓글