This program demonstrates the use of string formatting to add commas to large numbers. The format method is used to format each number with commas separating the thousands place, and the resulting formatted string is printed to the console using the print statement.
print("{:,}".format(2550000)) print("{:,}".format(255000)) print("{:,}".format(25500)) print("{:,}".format(2550)) print("{:,}".format(255)) print("{:,}".format(25)) print("{:,}".format(2))
2,550,000 255,000 25,500 2,550 255 25 2
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions