I seem to remember that there is a syntax in python to directly input numbers with comma separators (1,000,000
instead of 1000000
). Googling the issue gives either results on how to:
- Print numbers with comma separators
import locale
locale.setlocale(locale.LC_ALL, 'en_US')
locale.format("%d", 1255000, grouping=True)
- Remove commas from numbers to input into python
a = '1,000,000'
int(a.replace(',' , ''))
I don't want to do either and the plethora of results stops me from finding the information I need.