Python format string to use thousand separator

If we have a variable called variable_with_big_number we can use the following expresión to print a comman as a thousand separtor:

 

variable_with_big_number = 12345

f"{variable_with_big_number:,}"



Comentarios