Python useful methods