add_commas
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Last revisionBoth sides next revision | ||
add_commas [2021/01/13 20:48] – [input is a single number; without pandas] raju | add_commas [2021/01/13 20:53] – [input is a single number; without pandas] raju | ||
---|---|---|---|
Line 3: | Line 3: | ||
search tags | f strings, thousands separator, format integers with commas | search tags | f strings, thousands separator, format integers with commas | ||
==== input is a single number; without pandas ==== | ==== input is a single number; without pandas ==== | ||
+ | * ' | ||
+ | * f' | ||
+ | |||
< | < | ||
In [1]: | In [1]: | ||
Line 20: | Line 23: | ||
Out[3]: | Out[3]: | ||
' | ' | ||
+ | </ | ||
+ | |||
+ | Examples using a print statement | ||
+ | < | ||
+ | In [1]: | ||
+ | a = 123456 | ||
+ | |||
+ | In [2]: | ||
+ | print(' | ||
+ | The magic number is = 123,456 | ||
+ | |||
+ | In [3]: | ||
+ | print(' | ||
+ | The magic number is = 123,456 | ||
+ | |||
+ | In [4]: | ||
+ | print(' | ||
+ | The magic number is = 123456 | ||
</ | </ | ||
add_commas.txt · Last modified: 2021/01/13 20:57 by raju