I have a variable that contains a city, or city plus punctuation and then Post Code. I am using a statement to remove punctuation (and other stray) characters. It looks like this:
for c in "!@#%&*()[]{}/?<>,.":
jobLocationCleaned = string.replace(jobLocationUnclean, c, "")
jobLocation = jobLocationCleaned
# Add to list
params.append(jobLocation)
print(jobLocation)
However, when using Debug I can see the code step through and do the job it is supposed to yet when it comes to the print
statement it prints the address before it was cleaned, i.e. the for
loop has no effect.
Why is this?
jobLocationUnclean
?string.replace(variable,..
just dovariable.replace(...