In this program, we need to print output of a given integer in international place value format and put commas at the appropriate place, from the right.

Examples:

Input : 1000000 Output : 1,000,000 Input : 1000 Output : 1,000

Using {} along with format() function is introduced in Python 2.7 and is generally used in String formatting in place of “%”.

**Syntax**

" ".format()

Example:

Input : print ('{0}, {1}, {2}'.format('a', 'b', 'c')) Output : a, b, c Input : print ('{2}, {0}, {1}'.format('a', 'b', 'c')) Output : c, a, b

Here, we have used the “{:,}” along with the format() function to add commas every thousand places starting from left. This is introduced in Python3 and it automatically adds a comma on writing the following syntax.

`def` `place_value(number): ` ` ` `return` `(` `"{:,}"` `.` `format` `(number)) ` ` ` `print` `(place_value(` `1000000` `)) ` |

*chevron_right*

*filter_none*

Output:

1,000,000

This article is contributed by **Chinmoy Lenka**. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the **DSA Self Paced Course** at a student-friendly price and become industry ready.

## Recommended Posts:

- Python | Swap commas and dots in a String
- Print shortest path to print a string on screen
- Python | Print number of leap years from given list of years
- Python Program to print a number diamond of any given size N in Rangoli Style
- Print number of words, vowels and frequency of each character
- Print Bracket Number
- Print number in ascending order which contains 1, 2 and 3 in their digits.
- Program to print all the numbers divisible by 3 and 5 for a given number
- Print all 3 digit repeating numbers in a very large number
- Program to print Even Odd Number Pyramid
- Print a number as string of 'A' and 'B' in lexicographic order
- Queries to print the character that occurs the maximum number of times in a given range
- Program to print all the numbers divisible by 5 or 7 for a given number
- Print all the possible arithmetic expressions for a given number
- Print all K digit repeating numbers in a very large number
- How to print date starting from the given date for n number of days using Pandas?
- Print Single and Multiple variable in Python
- Python end parameter in print()
- Python | sep parameter in print()
- Python Program to print digit pattern