Replace spaces with dash and remove prefix from string
It sounds like you want to make a machine readable slug. Using a library for this function will save you lots of headache. python-slugify does what you are asking for and a bunch of other things you might not have even thought of.
artistName = artistName.replace(' ', '-').lower()
if artistName.startswith('the-'):
artistName = artistName[4:]
artistName = ''.join(e for e in artistName if e.isalnum() or e == '-')