Tech C**P
14 subscribers
161 photos
9 videos
59 files
304 links
مدرس و برنامه نویس پایتون و لینوکس @alirezastack
Download Telegram
How to use thousand separator in Python & Jinja2?

The python way is to use format as below:

'user credit is {:,}'.format(10000)


And in Jinja2 it is like the following line:

user credit is {{ '{0:,}'.format(user_credit | int) }}


#python #jinja2 #separator #thousand_separator
Did you know that python print command takes sep argument as a separator between string arguments?

print('ali', 'reza', sep=', ') # output: ali, reza


#python #print #sep #separator