With a binary string and list of one length, for example:
[0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0] stackoverflow
Is it possible to get a new line like -tc-over---- which follows:
[0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0] - t - c - over - - - -
That is, each character corresponding to 0 will be replaced as - . The desired result would be a list, as shown below, with letters matching 1 , and matching hyphen 0s are grouped separately:
['-', 't', '-', 'c', '-', 'over', '----']
Thanks!