- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is right shift (>>) operator in Python?
In Python >> is called right shift operator. It is a bitwise operator. It requires a bitwise representation of object as first operand. Bits are shifted to right by number of bits stipulated by second operand. Leading bits as towards left as a result of shifting are set to 0.
>>> bin(a) #binary equivalent 0110 0100 '0b1100100' >>> b=a>>2 #binary equivalent 0001 1101 >>> b 25 >>> bin(b) '0b11001'
- Related Articles
- What is JavaScript Bitwise Right Shift(>>) Operator?
- What is unsigned Right Shift Operator (>>>) in JavaScript?
- What is Bitwise Right Shift Operator (>>) in JavaScript?
- Bitwise right shift operator in Java
- What does the bitwise right shift operator do in Java?
- What is Bitwise Left Shift Operator (
- What are Left Shift and Right Shift Operators (>> and
- Java Shift Operator Examples
- Left Shift and Right Shift Operators in C/C++
- What does the bitwise left shift operator do in Java?
- What is @ operator in Python?
- Explain JavaScript Bitwise NOT, Left shift and Right shift?
- Bitwise right shift operators in C#
- Shift right in a BigInteger in Java
- What is operator binding in Python?

Advertisements