Underscores in Python numbers

Steven D'Aprano steve at REMOVETHIScyber.com.au
Sat Nov 19 05:57:17 EST 2005


On Sat, 19 Nov 2005 01:33:40 -0800, bearophileHUGS wrote:

> Steven D'Aprano:
>> Perhaps Python should concatenate numeric literals at compile time:
>> 123 456 is the same as 123456.
> 
> I think using the underscore it is more explicit:
> n = 123_456

It is also easy to make a typo:

n = 123-456


-- 
Steven.




More information about the Python-list mailing list