fork download
  1. junk = "ghGDakGsdDhggkHjahsghasdkgFSSoGDS"
  2. letter_to_find = 'o'
  3.  
  4. junk = "l" + junk + "l" # in case the sequence in question is
  5. # at the edge of the string
  6. bitstr = "".join(str(int(x.isupper())) for x in junk)
  7. letter = junk[bitstr.index('011101110') + 4]
  8.  
  9. print("Letter = %s. Correct? %s" % (letter, letter == letter_to_find))
Success #stdin #stdout 0.01s 9992KB
stdin
Standard input is empty
stdout
Letter = o. Correct? True