Create num.py

Helper functions