- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to bitwise XOR of hex numbers in Python?
You can get the XOR of any type of numbers using the ^ operator. Specifically for hex numbers, you can use:
a = 0x12ef b = 0xabcd print(hex(a ^ b))
This will give the output:
The 0x at the beginning of the numbers implies that the number is in hex representation. You can use the ^ operator for other integer representations as well.
- Bitwise XOR in Arduino
- Program to find XOR sum of all pairs bitwise AND in Python
- What is Bitwise XOR in C++?
- Bitwise AND of Numbers Range in C++
- Program to find bitwise AND of range of numbers in given range in Python
- How to perform Bitwise XOR operation on two images using Java OpenCV?
- Working with hex numbers in MySQL?
- Python program to print decimal octal hex and binary of first n numbers
- Count pairs with Bitwise XOR as EVEN number in C++
- Count pairs with Bitwise XOR as ODD number in C++
- How to Convert Hex String to Hex Number in C#?
- How to convert hex string into int in Python?