python print with formatting code example Example 1: print python format print('{} {}'.format(1, 2)) Example 2: python print format '{:10.5}'.format('xylophone')