Python Function Modify Variable Decelerations