My question is different because the answer conveys the deeper problem which is concise code vs forest like variables. I believe I deserve reputation points for pointing out the clarity of concise shortened variable code is for finding the logical problem.
I'm working on a Dataquest tutorial Great site for data Python btw and having problems with this string cleaning code. The cleaned string comes back exactly as the original with nothing parsed out.
here's the code, I tried to make it as concise as possible:
ss = open('story.txt', 'r').read()
cc = [",", ".", ";", "\n", "'"]
print(ss + "\n\n\n")
cleaned_story = ""
def clean_text(x, y):
cs = x
for e in y:
cs.replace(e, "")
cs = cs.lower()
return cs
cleaned_story = clean_text(ss, cc)
print(cleaned_story)
print(type(cleaned_story)) #this is just for weird test