Let's say I have a 0.txt file:
test1:hello
test2;niceee
test3:;okthen
and a code:
dct = dict()
with open('0.txt', 'r') as md5_file:
for line in md5_file:
hash_passw = line.strip().split(":", 1)[1]
dct[hash_passw] = hash_passw
print(dct)
Desired output would be:
hello
niceee
okthen
As you can see, every line has different delimiter, and I only know to go around it if all lines had exactly same delimiter : for example as seen in the code. What is the proper way to split the words and only get what is after the delimiter?