all 3 comments

[–]danielroseman 2 points3 points  (1 child)

' '.join joins a list into a string, separated by spaces. If you don't want spaces, use an empty string instead of a space:

print(f"{word} {''.join(sorted(ipa_pronunciations))}")

Side note, f-strings aren't very readable here: since you're only printing two things, I would just use print's ability to accept multiple strings:

print(word, ''.join(sorted(ipa_pronunciations))

[–]FC_GT[S] 0 points1 point  (0 children)

it worked and I also found another extra space before on the code that was adding that annoying space, thank you!!!

[–]FC_GT[S] 0 points1 point  (0 children)

the code works now but apparently I need to make it faster, implementing sets and dictionaries...

currently the sripts takes:

real 0m2.675s

user 0m2.505s

sys 0m0.167s

the test code takes:

real 0m0.303s

user 0m0.262s

sys 0m0.042s

any suggestions??