0

How can I Convert these binary input into hex values. Using python 3:

11111000 10011011

01101101 10011101

11100001 01111011

11000001 00010111

1 Answer 1

1

In your case you can do something like:

a = "11111000 10011011 01101101 10011101 11100001 01111011 11000001 00010111"
a = a.replace(" ", "")
i = int(a, 2)
print(hex(i))

A one-liner would be:

print(hex(int("11111000 10011011 01101101 10011101 11100001 01111011 11000001 00010111".replace(" ", ""), 2)))
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.