Converting Python 2 To Python 3 Mathematical Functions