0

How would I go about shortening a number like 1,000 into 1k, 1,000,000 into 1m, and so on in Python 3.X?

I have been experimenting with this line of code:

print("{:,}".format(1000)) # returns 1,000

I get errors when I place anything besides a comma there.

vlone
  • 33
  • 7

0 Answers0