How to fix error: Function does not return a value in Python | DevErrors