Operators in Python | EP-35 Bitwise Operators in Python | Right-shift, Left-shift, AND, OR, NOT, XOR

Subscribers:
28,000
Published on ● Video Link: https://www.youtube.com/watch?v=u-EPFfwEK2k



Duration: 0:00
61 views
2


Python Bitwise Operators

Python bitwise operators are used to perform bitwise calculations on integers. The integers are converted into binary and then operations are performed on each bit. The result will be in decimal format."""

Bitwise AND Operator

The two-bit integers are compared. If both compared bits are 1, then the resulting bit is 1. If not, it is 0.
a=7 #111
b=4 #100
print(a and b)

Bitwise OR Operator

if the both bits are 0 then the result is 0. If not, it is 1.
a=7 #111
b=4 #100
print(a or b)

Bitwise XOR Operator

The Python Bitwise XOR (^) Operator also known as the exclusive OR operator, is used to perform the XOR operation on two operands. If the bits are different, it returns 1;
otherwise, it returns 0.
a=7 #111
b=4 #100
print(a ^ b)

Bitwise NOT Operator

The Python Bitwise Not (~) Operator works with a single value and returns its one’s complement. This means it toggles all bits in the value, transforming 0 bits to 1 and 1 bits to 0, resulting in the one’s complement of the binary number.
a=10 #1010
print(~a)

Bitwise Shift

The bitwise shift operators move the bit values of a binary object. The left operand specifies the value to be shifted. The right operand specifies the number of positions that the bits in the value are to be shifted.

Python Bitwise Right Shift

Shifts the bits of the number to the right and fills 0 on voids left.

Python Bitwise Left Shift

Shifts the bits of the number to the left and fills 0 on voids right as a result.

#PythonTutorial #BitwiseOperators #PythonProgramming #PythonForBeginners #Coding #LearnPython #PythonTips #Programming #python #bitwiseoperators #python3 #python2 #programmingtutorial

Connect With Us:
—————————————
➡️ Website: https://www.cybrosys.com/
➡️ Email: info@cybrosys.com
➡️ Twitter:   / cybrosys  
➡️ LinkedIn:   / cybrosys  
➡️ Facebook:   / cybrosystechnologies  
➡️ Instagram:   / cybrosystech  
➡️ Pinterest:   / cybrosys  




Other Videos By Cybrosys Technologies


2024-09-12Return For Exchange in Odoo 18 Inventory | Odoo 18 New Features | Odoo 18 Inventory| Odoo 18 Release
2024-09-11What is Assignment Operator in Python | EP-36 Assignment Operator in Python | Free Python Tutorials
2024-09-10What are the Different Onboarding User Levels in HRMS | Free HR Software | Free Onboarding Software
2024-09-10Top Bar in Odoo 18 Project App | Odoo 18 Project Management | Odoo 18 New Features | Odoo 18 Release
2024-09-09How to Add New Employee in Horilla HRMS | Create New Employee in HRMS Software | Free HR Software
2024-09-09Loan Management in Odoo 18 Accounting | New Loan Management Feature in Odoo 18| Odoo 18 New Features
2024-09-06How to Assign Onboarding Tasks to an Employee in Horilla HRMS| Free HR Software| Onboarding Software
2024-09-05How to Configure Automation in Odoo 17 Project App | Automation in Odoo 17 Project | Odoo 17 Videos
2024-09-05How to Configure Credit Card in Odoo 18 Accounting | Credit Card in Odoo 18 | Odoo 18 New Features
2024-09-05Odoo 18 Point of Sale PWA | Odoo 18 POS Kiosk | Expected Features of Odoo 18 POS | Odoo 18 Features
2024-09-04Operators in Python | EP-35 Bitwise Operators in Python | Right-shift, Left-shift, AND, OR, NOT, XOR
2024-09-04How to Shortlist a Resume in Horilla HRMS | Resume Shortlisting | How to Get Your Resume Shortlisted
2024-09-04How to Generate Leads in Odoo 18 Event App | Lead Generation in Odoo 18 Event | Odoo 18 New Features
2024-09-03How to Set Up Mail Automation in Horilla HRMS | Email Automation Step-By-Step | Free HR Software
2024-09-03How to Manage Group Payment in Odoo 18 Accounting | Group Payment in Odoo 18 Accounting | Odoo 18
2024-09-03Drive-Thru AI | Cybrosys Revolutionize Your Drive-Thru with AI-Powered Odoo| The Future of Fast Food
2024-09-02What are Python Logical Operators| EP-34 Logical Operators in Python| AND, OR, NOT |Python Operators
2024-09-02What are the Different Views in Horilla HRMS Recruitment Pipeline | View Management of Candidates
2024-09-02How to Create New Commission Plan in Odoo 18 Sales App | Odoo 18 Sales Commission | Odoo 18 Features
2024-08-30How to Create Lead Generation Rule in Odoo 17 Event App | Lead Generation Rule in Odoo 17 | Odoo 17
2024-08-30How to Merge Multiple Vendor Bills in Odoo 18 Purchase App | Merge Multiple Vendor Bills in Odoo 18