PythonExtra/tests/basics/python36.py
Damien George 6a445b60fa py/lexer: Add support for underscores in numeric literals.
This is a very convenient feature introduced in Python 3.6 by PEP 515.
2018-06-12 12:17:43 +10:00

11 lines
221 B
Python

# tests for things that only Python 3.6 supports
# underscores in numeric literals
print(100_000)
print(0b1010_0101)
print(0xff_ff)
# underscore supported by int constructor
print(int('1_2_3'))
print(int('0o1_2_3', 8))