- Convert the integers 57 and 123 into one byte binary and hex.Show your work. Call the resulting hex values a and b.
- Compute the values of these Python Expressions:a | b a & b a ^ b
- Convert the results from Part 2 to hex and decimal. Show yourwork.
This is python assignment
Please don’t just copy and paste from another answer onhere.
Solution
a = 57b = 123print(a, ‘in binary is’, bin(a))print(a, ‘in hexadecimal is’, hex(a))print(b, ‘in binary is’, bin(b))print(b, ‘in hexadecimal is’, hex(b))print(“a | b is”, a | b, ‘in decimal’, hex(a | b), ‘in hexadecimal’, bin(a |
OR
OR