Javascript End A Function Python Format Printing