Mathematical functions in Python