Oct-12-2023, 09:11 AM
you can use a dict that maps old:new values and loop over it, instead or writing multiple repetitive lines
replacements = {'Verona':'Hellas Verona', 'Sassuolo':'Sassuolo Calcio'} for old_val, new_val in replacements.items(): fielddata = filedata.replace(old_val, new_val)
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs