Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Tamas Dukai
6,103 PointsFormat numbers in Python
Hi,
I'd like to know if there is a way to format long numbers (integers) the following way.
For example if I have the number 1166832000
can I display it like this: 11 66 832 000
or 11,66,832,000
Thanks
jacinator
11,936 PointsSince that would be a string output he could then use str.replace(",", " ") to achieve spaces.
Kent Åsvang
18,823 PointsKent Åsvang
18,823 PointsIf you are looking for thousand separators you could use this syntax. It will be commas though, not spaces.