my version of @dis.sociat.ing's dollcode algorithm in python

renamed chars tuple -> DOLLCODE_CHARS to avoid confusion with char loop var in print_dollcode

+2 -2
+2 -2
main.py
··· 4 4 parser.add_argument("number", type=int, help="number to convert") 5 5 args = parser.parse_args() 6 6 7 - char = ("▌", "▖", "▘") 7 + DOLLCODE_CHARS = ("▌", "▖", "▘") 8 8 9 9 10 10 def dollcode(num: int): ··· 20 20 else: 21 21 window = (window - mod) // 3 22 22 23 - output.insert(0, char[mod]) 23 + output.insert(0, DOLLCODE_CHARS[mod]) 24 24 limit -= 1 25 25 26 26 return output