How To Combine Two Functions In Python