[Solved] i want my code to output something like “example = .-.-.-.-” but rather it outputs “example = .- = .- = .- = .-” [closed]


cache += ' = ' was in the loop, causing the error.

def morse_encrypter (placeholder):
    cache = d
    cache += ' = '
    for letter in placeholder:
        cache += cheat_sheet [letter]
    return cache

3

solved i want my code to output something like “example = .-.-.-.-” but rather it outputs “example = .- = .- = .- = .-” [closed]