This works also but I thought it was possible to do it easier: import locale; locale.setlocale(locale.LC_ALL, ""); print('\n'.join(locale.format("%2f", i, 1) for i in range(1,20,4)))