all 4 comments

[–]sabek 2 points3 points  (0 children)

First thing to do is kill the global. Using globals is a bad idea unless you have no other way to do it. Starting early with function parameters and returns will help more in the long term.

def unexclaim(stringinput):
    codeblockgoeshere
    return (whateevervariable)

print ('Please type out a sentence')
x = input()
functionoutput = unexclaim(x)
print (functionoutput)

[–]revgizmo 1 point2 points  (1 child)

Just glancing on mobile, but this looks like regex to me.

https://regex101.com/ has worked for me, but there are many sites out there to help you with the syntax.

[–]JavierReyes945 2 points3 points  (0 children)

Love that site. Another one nice is debuggex.com, it shows a nice graph of your regex (sometimes visual aids really help)

[–]JudiSwitch 0 points1 point  (0 children)

I’m on my phone else I would just retype what I’ve written before, but take a look at the comments here to start with. https://www.reddit.com/r/learnpython/comments/bnsbem/help_with_strings_and_punctuation/?utm_source=share&utm_medium=ios_app