number = int(input())
# input: 2345212
print(f"{number:,}") # using inbuilt python's separator
# output:
# Giving this : 2,345,212
# desired output: 23,45,212
I wish to generate correctly formatted numbers as output. But, I am not able to figure it out. As in desired output ( 23,45,212 ) from the last, it has a comma after 3 places thereafter a comma is placed on passing 2 digits. In India, it's the standard form to place commas to digits.
Looking for the shortest trick.
[ Already tried locale. I want to print without currency( not this: ₹23,45,212.00 ) ]