Determine Power of Two in Python