How to fix ValueError: substring not found in Python | DevErrors