-2

eight character (zero and one) string -> turn it into 8 bit binary number -> perform binary operation -> turn back into 8 0/1 string

>>> the_entry = "00000000"
>>> the_binary number = 8CharacterStringIntoThe8CharacterBinaryNumber(the_entry)
>>> the_binary_number << 1 # any binary operation
>>> the_result_string = EightCharacterBinaryNumberIntoEightCharacterString(the_binary_number)

this is soo simple, I refuse to write my own method, but obviously, in th 180000 possible results, I cannot find the one related to my question.

Do you hold the magic??

7
  • I didn't understand what your question is. Can you please phrase this more clearly? Commented May 4, 2021 at 13:21
  • I would like to turn an eight number string into an 8 bit binary number, perform bitwise operations on the binary and return the 8character string representation of this number Commented May 4, 2021 at 13:23
  • Are you asking this? (1) stackoverflow.com/questions/8928240/…; (2) stackoverflow.com/questions/699866/python-int-to-binary-string Commented May 4, 2021 at 13:23
  • 1
    "I refuse to write my own method" That's not how to win a crowd... Commented May 4, 2021 at 13:23
  • I am reluctant of reinventing the wheel, maybe that would sound better] Commented May 4, 2021 at 13:28

1 Answer 1

1

These are simple basic operations:

entry = "00000000"
number = int(entry, 2)
result = f"{number:08b}"
Sign up to request clarification or add additional context in comments.

2 Comments

but then your number will be an integer, not a binary or byte ...
This was it!! thank you so much!! simple and concise

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.