Search code examples
pythoninitializationint

How to construct an integer with spaces between numbers?


In Java, I think you can initialize int 40000000 as 40_000_000.

Is there anything like that in python ?


Solution

  • As of Python 3.6, the same syntax is accepted in Python: What's New in 3.6: Underscores in Numeric Literals