Skip to content

Commit

Permalink
check functioning of left and right shift operators in python
Browse files Browse the repository at this point in the history
  • Loading branch information
justanindieguy committed Jan 17, 2023
1 parent 4322924 commit a374456
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Bit-manipulationTechniques/LeftRightShift/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
def main():
num = 10

# a * 2^b
print("Left Shift Operator:", num << 2)

# a / 2^b
print("Right Shift Operator:", num >> 2)


if __name__ == "__main__":
main()

0 comments on commit a374456

Please sign in to comment.