How To Write A Switch Function Python