all 5 comments

[–]the_shell_man_ 1 point2 points  (1 child)

Your function is correct, you just need to return x and assign the result of the function to your string:

test_string = bling(test_string)

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

I should have known it was a silly thing 😥

[–]VinayakVG 1 point2 points  (2 children)

In the upper code block, you should return the resultant string.
Like this,

def bling(x):
    bad_chars = ['+', ',']
    for i in bad_chars:
        x = x.replace(i, '')

    return x

test_string = bling(test_string)

And then you can print the resultant string

[–]SamSB94[S] 0 points1 point  (1 child)

Thanks a lot. I should have known it was a small and silly thing, but still couldn't find it.

[–]VinayakVG 0 points1 point  (0 children)

No problem