-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??

frank
  • 21
  • 4
  • I didn't understand what your question is. Can you please phrase this more clearly? – mkrieger1 May 04 '21 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 – frank May 04 '21 at 13:23
  • Are you asking this? (1) https://stackoverflow.com/questions/8928240/convert-base-2-binary-number-string-to-int; (2) https://stackoverflow.com/questions/699866/python-int-to-binary-string – mkrieger1 May 04 '21 at 13:23
  • 1
    "I refuse to write my own method" That's not how to win a crowd... – MisterMiyagi May 04 '21 at 13:23
  • I am reluctant of reinventing the wheel, maybe that would sound better] – frank May 04 '21 at 13:28
  • Indeed that would help. As would clearly defining what you need, seeing how you seem not satisfied with the answer/dupes you got. Even though they do exactly what you asked for. – MisterMiyagi May 04 '21 at 13:36
  • @MisterMiyagi you are not getting the point, that is all right, you seem not to be too used with communities, that is also allright, thank you for your time anyway, even though unsupportive :) – frank May 04 '21 at 13:42

1 Answers1

1

These are simple basic operations:

entry = "00000000"
number = int(entry, 2)
result = f"{number:08b}"
Daniel
  • 42,087
  • 4
  • 55
  • 81